[GH-ISSUE #8] Add Bergamot translation #2

Closed
opened 2026-03-23 20:31:06 +00:00 by mirror · 3 comments
Owner

Originally created by @pjlammertyn on GitHub (May 8, 2023).
Original GitHub issue: https://github.com/RADar-AZDelta/Keun/issues/8

Originally assigned to: @BostoenToby on GitHub.

site: https://browser.mt/
github: https://github.com/browsermt/bergamot-translator
latest release: https://github.com/browsermt/bergamot-translator/releases/tag/latest
latest models: https://github.com/mozilla/firefox-translations-models
example implementation: https://github.com/mozilla/translate

de taal kan gedetecteerd worden met i18n.detectLanguage()

code van de Firefox textension kan gebruikt worden om de modellen te downloaden: https://github.com/mozilla/firefox-translations/blob/main/extension/model/modelRegistry.js (**maar dit is blijkbaar een oude versie 0.3.4 terwijl bergamot reeds aan versie 0.4.5 zit! maar deze bevat blijkbaar geen nederlands :( (github.com/browsermt/bergamot-translator@8d5f877596/wasm/module/translator.js (L75) https://bergamot.s3.amazonaws.com/models/index.json)

afbeelding

Originally created by @pjlammertyn on GitHub (May 8, 2023). Original GitHub issue: https://github.com/RADar-AZDelta/Keun/issues/8 Originally assigned to: @BostoenToby on GitHub. site: https://browser.mt/ github: https://github.com/browsermt/bergamot-translator latest release: https://github.com/browsermt/bergamot-translator/releases/tag/latest latest models: https://github.com/mozilla/firefox-translations-models example implementation: https://github.com/mozilla/translate de taal kan gedetecteerd worden met [i18n.detectLanguage()](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/i18n/detectLanguage) code van de Firefox textension kan gebruikt worden om de modellen te downloaden: https://github.com/mozilla/firefox-translations/blob/main/extension/model/modelRegistry.js (**maar dit is blijkbaar een oude versie 0.3.4 terwijl bergamot reeds aan versie 0.4.5 zit! maar deze bevat blijkbaar geen nederlands :( (https://github.com/browsermt/bergamot-translator/blob/8d5f877596386584caf1a13c5aae7f4427708ca9/wasm/module/translator.js#L75 https://bergamot.s3.amazonaws.com/models/index.json) ![afbeelding](https://user-images.githubusercontent.com/1187178/236925226-75dad0c5-7fcd-46e0-aa81-a191079f5b5c.png)
Author
Owner

@pjlammertyn commented on GitHub (May 8, 2023):

the https://addons.mozilla.org/en-US/firefox/addon/translatelocally-for-firefox/ extension points in there source code https://github.com/jelmervdl/translatelocally-web-ext/blob/main/src/background/WASMTranslationHelper.js#L43 towards https://data.statmt.org/bergamot/models/ for their models, but no dutch model is available

<!-- gh-comment-id:1539001914 --> @pjlammertyn commented on GitHub (May 8, 2023): the https://addons.mozilla.org/en-US/firefox/addon/translatelocally-for-firefox/ extension points in there source code https://github.com/jelmervdl/translatelocally-web-ext/blob/main/src/background/WASMTranslationHelper.js#L43 towards https://data.statmt.org/bergamot/models/ for their models, but no dutch model is available
Author
Owner

@pjlammertyn commented on GitHub (May 8, 2023):

also take a look at the translation test code: https://github.com/RADar-AZDelta/svelte-translation/blob/master/src/lib/MozillaTranslationComponent.svelte
Here the models are in the static folder (so this is problematic but possibly the only workable solution)

perhaps we wil need to add a seperate github repo to host the models

<!-- gh-comment-id:1539048797 --> @pjlammertyn commented on GitHub (May 8, 2023): also take a look at the translation test code: https://github.com/RADar-AZDelta/svelte-translation/blob/master/src/lib/MozillaTranslationComponent.svelte Here the models are in the static folder (so this is problematic but possibly the only workable solution) perhaps we wil need to add a seperate github repo to host the models
Author
Owner

@pjlammertyn commented on GitHub (May 9, 2023):

@BostoenToby you should start with the https://github.com/RADar-AZDelta/svelte-translation POC.
But you need the solve the build issue (probably with the vite-plugin-static-copy plugin)

pnpm run build
pnpm run preview

afbeelding

<!-- gh-comment-id:1539457523 --> @pjlammertyn commented on GitHub (May 9, 2023): @BostoenToby you should start with the https://github.com/RADar-AZDelta/svelte-translation POC. But you need the solve the build issue (probably with the [vite-plugin-static-copy](https://www.npmjs.com/package/vite-plugin-static-copy) plugin) ```bash pnpm run build pnpm run preview ``` ![afbeelding](https://user-images.githubusercontent.com/1187178/237007465-85d68c34-8b6c-4f33-928c-d0b441c970ed.png)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
RADar-AZDelta/archived-Keun#2
No description provided.