Skip to content

feat(bingtrans): add Bing Translate dictionary - #2341

Merged
crimx merged 1 commit into
crimx:devfrom
doraemonkeys:feat/dict-bingtrans
Jul 6, 2026
Merged

feat(bingtrans): add Bing Translate dictionary#2341
crimx merged 1 commit into
crimx:devfrom
doraemonkeys:feat/dict-bingtrans

Conversation

@doraemonkeys

Copy link
Copy Markdown
Contributor

Add a keyless Bing/Microsoft Translate machine-translation dictionary, following the upstream machine-custom pattern (see niutrans).

  • Auth via the keyless Edge endpoint (edge.microsoft.com/translate/auth), token cached ~8min; translate via api-edge.cognitive.microsofttranslator.com.
  • Reuse machine-custom helpers (language helper, result builders, language-code normalization) and axios so MV2/MV3 share one network path.
  • Register in defaultAllDicts and mark as background-preferred for MV3 (needs privileged network APIs, like the other machine translators).
  • Unit tests cover language mapping, param building, response parsing, and success/empty/error paths.

Add a keyless Bing/Microsoft Translate machine-translation dictionary,
following the upstream machine-custom pattern (see niutrans).

- Auth via the keyless Edge endpoint (edge.microsoft.com/translate/auth),
  token cached ~8min; translate via api-edge.cognitive.microsofttranslator.com.
- Reuse machine-custom helpers (language helper, result builders,
  language-code normalization) and axios so MV2/MV3 share one network path.
- Register in defaultAllDicts and mark as background-preferred for MV3
  (needs privileged network APIs, like the other machine translators).
- Unit tests cover language mapping, param building, response parsing,
  and success/empty/error paths.
@crimx

crimx commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Thanks!

@crimx
crimx merged commit 2d130d2 into crimx:dev Jul 6, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants