feat: add message translation support

- Introduced translation functionality in chat screen, allowing users to translate messages before sending.
- Added MessageTranslationButton to the input bar for enabling/disabling translation.
- Implemented translation service to handle incoming and outgoing text translations using llama models.
- Enhanced message storage to include original and translated text, language codes, and translation status.
- Created UI components for displaying translated messages and managing translation options.
- Added translation model management, including downloading and storing models locally.
- Updated app settings to manage translation preferences and model selections.
This commit is contained in:
zjs81
2026-04-02 19:09:17 -07:00
parent 82adbd761b
commit 9bf649e2c6
57 changed files with 4879 additions and 184 deletions
+45 -2
View File
@@ -2042,6 +2042,35 @@
"radioStats_stripWaiting": "Fetching radio stats…",
"radioStats_settingsTile": "Radio stats",
"radioStats_settingsSubtitle": "Noise floor, RSSI, SNR, and airtime",
"translation_title": "Translation",
"translation_enableTitle": "Enable translation",
"translation_enableSubtitle": "Translate incoming messages and allow pre-send translation.",
"translation_composerTitle": "Translate before sending",
"translation_composerSubtitle": "Controls the default state of the composer translation icon.",
"translation_targetLanguage": "Target language",
"translation_useAppLanguage": "Use app language",
"translation_downloadedModelLabel": "Downloaded model",
"translation_presetModelLabel": "Preset Hugging Face model",
"translation_manualUrlLabel": "Manual model URL",
"translation_downloadModel": "Download model",
"translation_downloading": "Downloading...",
"translation_working": "Working...",
"translation_stop": "Stop",
"translation_mergingChunks": "Merging downloaded chunks into final file...",
"translation_downloadedModels": "Downloaded models",
"translation_deleteModel": "Delete model",
"translation_modelDownloaded": "Translation model downloaded.",
"translation_downloadStopped": "Download stopped.",
"translation_downloadFailed": "Download failed: {error}",
"@translation_downloadFailed": {
"placeholders": {
"error": {
"type": "String"
}
}
},
"translation_enterUrlFirst": "Enter a model URL first.",
"scanner_linuxPairingShowPin": "Show PIN",
"scanner_linuxPairingHidePin": "Hide PIN",
"scanner_linuxPairingPinTitle": "Bluetooth Pairing PIN",
@@ -2052,5 +2081,19 @@
"type": "String"
}
}
}
}
},
"translation_messageTranslation": "Message translation",
"translation_translateBeforeSending": "Translate before sending",
"translation_composerEnabledHint": "Messages will be translated before send.",
"translation_composerDisabledHint": "Send messages in the original typed language.",
"translation_translateTo": "Translate to {language}",
"@translation_translateTo": {
"placeholders": {
"language": {
"type": "String"
}
}
},
"translation_translationOptions": "Translation options",
"translation_systemLanguage": "System language"
}