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

@@ -335,6 +335,7 @@ export function setDatabase(data:Database){
data.mancerHeader ??= ''
data.emotionProcesser ??= 'submodel'
data.translatorType ??= 'google'
data.htmlTranslation ??= false
data.deeplOptions ??= {
key:'',
freeApi: false
@@ -736,8 +737,9 @@ export interface Database{
mancerHeader:string
emotionProcesser:'submodel'|'embedding',
showMenuChatList?:boolean,
translatorType:'google'|'deepl'|'none'|'llm'|'deeplX',
translatorType:'google'|'deepl'|'none'|'llm'|'deeplX'|'bergamot',
translatorInputLanguage?:string
htmlTranslation?:boolean,
NAIadventure?:boolean,
NAIappendName?:boolean,
deeplOptions:{