Add Firefox(Bergamot) local translation (#794)

# PR Checklist
- [ ] Have you checked if it works normally in all models? *Ignore this
if it doesn't use models.*
- [ ] Have you checked if it works normally in all web, local, and node
hosted versions? If it doesn't, have you blocked it in those versions?
- [ ] Have you added type definitions?

# Description
Translation is performed using the models hosted in the repository:
https://github.com/mozilla/firefox-translations-models/

When the translation is first running, the model is downloaded from the
repository.

Testing completed for `npm dev` and Node server environment.
This commit is contained in:
kwaroran
2025-03-17 16:05:46 +09:00
committed by GitHub
17 changed files with 3576 additions and 1 deletions

View File

@@ -90,6 +90,7 @@
<OptionInput value="deepl" >DeepL</OptionInput>
<OptionInput value="llm" >Ax. Model</OptionInput>
<OptionInput value="deeplX" >DeepL X</OptionInput>
<OptionInput value="bergamot" >Firefox</OptionInput>
</SelectInput>
{#if DBState.db.translatorType === 'deepl'}
@@ -135,6 +136,11 @@
</SelectInput>
{/if}
{#if DBState.db.translatorType === 'bergamot'}
<div class="flex items-center mt-4">
<Check bind:check={DBState.db.htmlTranslation} name={language.htmlTranslation}/>
</div>
{/if}
<div class="flex items-center mt-2">
<Check bind:check={DBState.db.autoTranslate} name={language.autoTranslation}/>