Use one model row for image and translation downloads

Image settings, translation settings, and the restore prompt each listed models differently. Share ModelDownloadList so every model shows the same name, size, status, selection, and download, cancel, or remove action.

Co-authored-by: zjs81 <zjs81@users.noreply.github.com>
This commit is contained in:
Cursor Agentandzjs81 committed 2026-11-21 00:05:39 +00:00
1 parent 34ea0cb7ca
commit 9ffdbaae09
50 files changed
+2524 -833

No files matched your search

+11 -2
View File
@@ -3756,7 +3756,7 @@
"backupRestore_backupComplete": "Файлът с резервно копие е създаден.",
"backupRestore_restoreComplete": "Възстановяването приключи. Свържете се отново, ако сте възстановили идентичността на радиото.",
"backupRestore_missingModelsTitle": "Моделите не са изтеглени",
"backupRestore_missingModelsMessage": "Възстановените настройки избират модели, които не са налични на това устройство:\n{models}\n\nДа се изтеглят ли сега?",
"backupRestore_missingModelsMessage": "Възстановените настройки избират модели, които не са налични на това устройство. Да се изтеглят ли сега?",
"backupRestore_downloadModels": "Изтегли модели",
"backupRestore_downloading": "Изтегляне…",
"backupRestore_cancelDownload": "Отмени изтеглянето",
@@ -3776,5 +3776,14 @@
"connectSheet_chooseRadioSubtitle": "Bluetooth, USB или TCP",
"connectSheet_stopReconnecting": "Спри повторното свързване",
"connectSheet_reconnectFailed": "Няма връзка с {name}. Уверете се, че е включено и наблизо.",
"chat_composerOffline": "Свържете се с радио, за да изпращате съобщения"
"chat_composerOffline": "Свържете се с радио, за да изпращате съобщения",
"modelDownload_notDownloaded": "Не е изтеглен",
"modelDownload_downloading": "Изтегляне",
"modelDownload_active": "Активен",
"modelDownload_failed": "Неуспешно изтегляне",
"modelDownload_incomplete": "Непълен",
"modelDownload_verifying": "Проверка на изтеглянето",
"modelDownload_useModel": "Използвай този модел",
"modelDownload_removeFailed": "Моделът не можа да бъде премахнат: {error}",
"modelDownload_progress": "{current} / {total} MB ({percent}%)"
}
+11 -2
View File
@@ -4369,7 +4369,7 @@
"backupRestore_backupComplete": "Soubor zálohy byl vytvořen.",
"backupRestore_restoreComplete": "Obnovení dokončeno. Pokud jste obnovili identitu rádia, připojte se znovu.",
"backupRestore_missingModelsTitle": "Modely nejsou stažené",
"backupRestore_missingModelsMessage": "Obnovené nastavení vybírá modely, které nejsou v tomto zařízení k dispozici:\n{models}\n\nStáhnout je nyní?",
"backupRestore_missingModelsMessage": "Obnovené nastavení vybírá modely, které nejsou v tomto zařízení k dispozici. Stáhnout je nyní?",
"backupRestore_downloadModels": "Stáhnout modely",
"backupRestore_downloading": "Stahování…",
"backupRestore_cancelDownload": "Zrušit stahování",
@@ -4389,5 +4389,14 @@
"connectSheet_chooseRadioSubtitle": "Bluetooth, USB nebo TCP",
"connectSheet_stopReconnecting": "Zastavit připojování",
"connectSheet_reconnectFailed": "Nelze se spojit s {name}. Ujistěte se, že je zapnuté a nablízku.",
"chat_composerOffline": "Pro odesílání zpráv se připojte k rádiu"
"chat_composerOffline": "Pro odesílání zpráv se připojte k rádiu",
"modelDownload_notDownloaded": "Nestaženo",
"modelDownload_downloading": "Stahování",
"modelDownload_active": "Aktivní",
"modelDownload_failed": "Stažení se nezdařilo",
"modelDownload_incomplete": "Neúplné",
"modelDownload_verifying": "Ověřování stažení",
"modelDownload_useModel": "Použít tento model",
"modelDownload_removeFailed": "Model se nepodařilo odebrat: {error}",
"modelDownload_progress": "{current} / {total} MB ({percent}%)"
}
+11 -2
View File
@@ -3891,7 +3891,7 @@
"backupRestore_backupComplete": "Sicherungsdatei erstellt.",
"backupRestore_restoreComplete": "Wiederherstellung abgeschlossen. Verbinden Sie sich erneut, wenn Sie die Funkidentität wiederhergestellt haben.",
"backupRestore_missingModelsTitle": "Modelle nicht heruntergeladen",
"backupRestore_missingModelsMessage": "Die wiederhergestellten Einstellungen wählen Modelle aus, die auf diesem Gerät nicht verfügbar sind:\n{models}\n\nJetzt herunterladen?",
"backupRestore_missingModelsMessage": "Die wiederhergestellten Einstellungen wählen Modelle aus, die auf diesem Gerät nicht verfügbar sind. Jetzt herunterladen?",
"backupRestore_downloadModels": "Modelle herunterladen",
"backupRestore_downloading": "Wird heruntergeladen…",
"backupRestore_cancelDownload": "Download abbrechen",
@@ -3911,5 +3911,14 @@
"connectSheet_chooseRadioSubtitle": "Bluetooth, USB oder TCP",
"connectSheet_stopReconnecting": "Wiederverbindung abbrechen",
"connectSheet_reconnectFailed": "{name} ist nicht erreichbar. Stellen Sie sicher, dass es eingeschaltet und in der Nähe ist.",
"chat_composerOffline": "Mit einem Funkgerät verbinden, um Nachrichten zu senden"
"chat_composerOffline": "Mit einem Funkgerät verbinden, um Nachrichten zu senden",
"modelDownload_notDownloaded": "Nicht heruntergeladen",
"modelDownload_downloading": "Wird heruntergeladen",
"modelDownload_active": "Aktiv",
"modelDownload_failed": "Download fehlgeschlagen",
"modelDownload_incomplete": "Unvollständig",
"modelDownload_verifying": "Download wird geprüft",
"modelDownload_useModel": "Dieses Modell verwenden",
"modelDownload_removeFailed": "Das Modell konnte nicht entfernt werden: {error}",
"modelDownload_progress": "{current} / {total} MB ({percent}%)"
}
+22 -6
View File
@@ -237,12 +237,7 @@
"backupRestore_backupComplete": "Backup file created.",
"backupRestore_restoreComplete": "Restore complete. Reconnect if you restored the radio identity.",
"backupRestore_missingModelsTitle": "Models Not Downloaded",
"backupRestore_missingModelsMessage": "The restored settings select models that are not available on this device:\n{models}\n\nDownload them now?",
"@backupRestore_missingModelsMessage": {
"placeholders": {
"models": {"type": "String"}
}
},
"backupRestore_missingModelsMessage": "The restored settings select models that are not on this device. Download them now?",
"backupRestore_downloadModels": "Download Models",
"backupRestore_downloading": "Downloading…",
"backupRestore_cancelDownload": "Cancel Download",
@@ -4341,5 +4336,26 @@
"chat_composerOffline": "Connect to a radio to send messages",
"@chat_composerOffline": {
"description": "Shown in place of the message box while no radio is connected"
},
"modelDownload_notDownloaded": "Not downloaded",
"modelDownload_downloading": "Downloading",
"modelDownload_active": "Active",
"modelDownload_failed": "Couldn't download",
"modelDownload_incomplete": "Incomplete",
"modelDownload_verifying": "Verifying the download",
"modelDownload_useModel": "Use this model",
"modelDownload_removeFailed": "Couldn't remove the model: {error}",
"modelDownload_progress": "{current} / {total} MB ({percent}%)",
"@modelDownload_removeFailed": {
"placeholders": {
"error": {"type": "String"}
}
},
"@modelDownload_progress": {
"placeholders": {
"current": {"type": "String"},
"total": {"type": "String"},
"percent": {"type": "String"}
}
}
}
+11 -2
View File
@@ -3942,7 +3942,7 @@
"backupRestore_backupComplete": "Archivo de copia de seguridad creado.",
"backupRestore_restoreComplete": "Restauración completada. Reconecta si restauraste la identidad de la radio.",
"backupRestore_missingModelsTitle": "Modelos no descargados",
"backupRestore_missingModelsMessage": "Los ajustes restaurados seleccionan modelos que no están disponibles en este dispositivo:\n{models}\n\n¿Descargarlos ahora?",
"backupRestore_missingModelsMessage": "Los ajustes restaurados seleccionan modelos que no están disponibles en este dispositivo. ¿Descargarlos ahora?",
"backupRestore_downloadModels": "Descargar modelos",
"backupRestore_downloading": "Descargando…",
"backupRestore_cancelDownload": "Cancelar descarga",
@@ -3962,5 +3962,14 @@
"connectSheet_chooseRadioSubtitle": "Bluetooth, USB o TCP",
"connectSheet_stopReconnecting": "Dejar de reconectar",
"connectSheet_reconnectFailed": "No se pudo conectar con {name}. Comprueba que esté encendida y cerca.",
"chat_composerOffline": "Conéctate a una radio para enviar mensajes"
"chat_composerOffline": "Conéctate a una radio para enviar mensajes",
"modelDownload_notDownloaded": "No descargado",
"modelDownload_downloading": "Descargando",
"modelDownload_active": "Activo",
"modelDownload_failed": "No se pudo descargar",
"modelDownload_incomplete": "Incompleto",
"modelDownload_verifying": "Comprobando la descarga",
"modelDownload_useModel": "Usar este modelo",
"modelDownload_removeFailed": "No se pudo quitar el modelo: {error}",
"modelDownload_progress": "{current} / {total} MB ({percent}%)"
}
+11 -2
View File
@@ -3890,7 +3890,7 @@
"backupRestore_backupComplete": "Fichier de sauvegarde créé.",
"backupRestore_restoreComplete": "Restauration terminée. Reconnectez-vous si vous avez restauré l'identité de la radio.",
"backupRestore_missingModelsTitle": "Modèles non téléchargés",
"backupRestore_missingModelsMessage": "Les réglages restaurés sélectionnent des modèles indisponibles sur cet appareil :\n{models}\n\nLes télécharger maintenant ?",
"backupRestore_missingModelsMessage": "Les réglages restaurés sélectionnent des modèles indisponibles sur cet appareil. Les télécharger maintenant ?",
"backupRestore_downloadModels": "Télécharger les modèles",
"backupRestore_downloading": "Téléchargement…",
"backupRestore_cancelDownload": "Annuler le téléchargement",
@@ -3910,5 +3910,14 @@
"connectSheet_chooseRadioSubtitle": "Bluetooth, USB ou TCP",
"connectSheet_stopReconnecting": "Arrêter la reconnexion",
"connectSheet_reconnectFailed": "Impossible de joindre {name}. Vérifiez qu'elle est allumée et à proximité.",
"chat_composerOffline": "Connectez-vous à une radio pour envoyer des messages"
"chat_composerOffline": "Connectez-vous à une radio pour envoyer des messages",
"modelDownload_notDownloaded": "Non téléchargé",
"modelDownload_downloading": "Téléchargement",
"modelDownload_active": "Actif",
"modelDownload_failed": "Échec du téléchargement",
"modelDownload_incomplete": "Incomplet",
"modelDownload_verifying": "Vérification du téléchargement",
"modelDownload_useModel": "Utiliser ce modèle",
"modelDownload_removeFailed": "Impossible de retirer le modèle : {error}",
"modelDownload_progress": "{current} / {total} MB ({percent}%)"
}
+11 -2
View File
@@ -3847,7 +3847,7 @@
"backupRestore_backupComplete": "A mentési fájl elkészült.",
"backupRestore_restoreComplete": "A visszaállítás kész. Csatlakozzon újra, ha a rádió azonosítóját is visszaállította.",
"backupRestore_missingModelsTitle": "A modellek nincsenek letöltve",
"backupRestore_missingModelsMessage": "A visszaállított beállítások olyan modelleket választanak, amelyek nem érhetők el ezen az eszközön:\n{models}\n\nLetölti őket most?",
"backupRestore_missingModelsMessage": "A visszaállított beállítások olyan modelleket választanak, amelyek nem érhetők el ezen az eszközön. Letölti őket most?",
"backupRestore_downloadModels": "Modellek letöltése",
"backupRestore_downloading": "Letöltés…",
"backupRestore_cancelDownload": "Letöltés megszakítása",
@@ -3867,5 +3867,14 @@
"connectSheet_chooseRadioSubtitle": "Bluetooth, USB vagy TCP",
"connectSheet_stopReconnecting": "Újracsatlakozás leállítása",
"connectSheet_reconnectFailed": "Nem érhető el: {name}. Ellenőrizze, hogy be van-e kapcsolva és a közelben van-e.",
"chat_composerOffline": "Üzenetküldéshez csatlakozzon rádióhoz"
"chat_composerOffline": "Üzenetküldéshez csatlakozzon rádióhoz",
"modelDownload_notDownloaded": "Nincs letöltve",
"modelDownload_downloading": "Letöltés",
"modelDownload_active": "Aktív",
"modelDownload_failed": "A letöltés sikertelen",
"modelDownload_incomplete": "Hiányos",
"modelDownload_verifying": "A letöltés ellenőrzése",
"modelDownload_useModel": "Ezt a modellt használja",
"modelDownload_removeFailed": "A modellt nem sikerült eltávolítani: {error}",
"modelDownload_progress": "{current} / {total} MB ({percent}%)"
}
+11 -2
View File
@@ -3890,7 +3890,7 @@
"backupRestore_backupComplete": "File di backup creato.",
"backupRestore_restoreComplete": "Ripristino completato. Riconnettiti se hai ripristinato l'identità della radio.",
"backupRestore_missingModelsTitle": "Modelli non scaricati",
"backupRestore_missingModelsMessage": "Le impostazioni ripristinate selezionano modelli non disponibili su questo dispositivo:\n{models}\n\nScaricarli ora?",
"backupRestore_missingModelsMessage": "Le impostazioni ripristinate selezionano modelli non disponibili su questo dispositivo. Scaricarli ora?",
"backupRestore_downloadModels": "Scarica modelli",
"backupRestore_downloading": "Download in corso…",
"backupRestore_cancelDownload": "Annulla download",
@@ -3910,5 +3910,14 @@
"connectSheet_chooseRadioSubtitle": "Bluetooth, USB o TCP",
"connectSheet_stopReconnecting": "Interrompi la riconnessione",
"connectSheet_reconnectFailed": "Impossibile raggiungere {name}. Assicurati che sia acceso e nelle vicinanze.",
"chat_composerOffline": "Connettiti a una radio per inviare messaggi"
"chat_composerOffline": "Connettiti a una radio per inviare messaggi",
"modelDownload_notDownloaded": "Non scaricato",
"modelDownload_downloading": "Download in corso",
"modelDownload_active": "Attivo",
"modelDownload_failed": "Download non riuscito",
"modelDownload_incomplete": "Incompleto",
"modelDownload_verifying": "Verifica del download",
"modelDownload_useModel": "Usa questo modello",
"modelDownload_removeFailed": "Impossibile rimuovere il modello: {error}",
"modelDownload_progress": "{current} / {total} MB ({percent}%)"
}
+11 -2
View File
@@ -4096,7 +4096,7 @@
"backupRestore_backupComplete": "バックアップファイルを作成しました。",
"backupRestore_restoreComplete": "復元が完了しました。無線機のIDを復元した場合は再接続してください。",
"backupRestore_missingModelsTitle": "モデル未ダウンロード",
"backupRestore_missingModelsMessage": "復元された設定で選択されているモデルが、このデバイスにありません:\n{models}\n\n今すぐダウンロードしますか?",
"backupRestore_missingModelsMessage": "復元された設定で選択されているモデルが、このデバイスにありません。今すぐダウンロードしますか?",
"backupRestore_downloadModels": "モデルをダウンロード",
"backupRestore_downloading": "ダウンロード中…",
"backupRestore_cancelDownload": "ダウンロードをキャンセル",
@@ -4116,5 +4116,14 @@
"connectSheet_chooseRadioSubtitle": "Bluetooth、USB、またはTCP",
"connectSheet_stopReconnecting": "再接続を停止",
"connectSheet_reconnectFailed": "{name} に接続できませんでした。電源が入っていて近くにあることを確認してください。",
"chat_composerOffline": "メッセージを送信するには無線機に接続してください"
"chat_composerOffline": "メッセージを送信するには無線機に接続してください",
"modelDownload_notDownloaded": "未ダウンロード",
"modelDownload_downloading": "ダウンロード中",
"modelDownload_active": "使用中",
"modelDownload_failed": "ダウンロードできませんでした",
"modelDownload_incomplete": "未完了",
"modelDownload_verifying": "ダウンロードを確認しています",
"modelDownload_useModel": "このモデルを使う",
"modelDownload_removeFailed": "モデルを削除できませんでした: {error}",
"modelDownload_progress": "{current} / {total} MB ({percent}%)"
}
+11 -2
View File
@@ -4096,7 +4096,7 @@
"backupRestore_backupComplete": "백업 파일을 만들었습니다.",
"backupRestore_restoreComplete": "복원이 완료되었습니다. 무전기 ID를 복원했다면 다시 연결하세요.",
"backupRestore_missingModelsTitle": "모델이 다운로드되지 않음",
"backupRestore_missingModelsMessage": "복원된 설정에서 선택한 모델이 이 기기에 없습니다:\n{models}\n\n지금 다운로드할까요?",
"backupRestore_missingModelsMessage": "복원된 설정에서 선택한 모델이 이 기기에 없습니다. 지금 다운로드할까요?",
"backupRestore_downloadModels": "모델 다운로드",
"backupRestore_downloading": "다운로드 중…",
"backupRestore_cancelDownload": "다운로드 취소",
@@ -4116,5 +4116,14 @@
"connectSheet_chooseRadioSubtitle": "Bluetooth, USB 또는 TCP",
"connectSheet_stopReconnecting": "재연결 중지",
"connectSheet_reconnectFailed": "{name}에 연결할 수 없습니다. 전원이 켜져 있고 가까이 있는지 확인하세요.",
"chat_composerOffline": "메시지를 보내려면 무전기에 연결하세요"
"chat_composerOffline": "메시지를 보내려면 무전기에 연결하세요",
"modelDownload_notDownloaded": "다운로드되지 않음",
"modelDownload_downloading": "다운로드 중",
"modelDownload_active": "사용 중",
"modelDownload_failed": "다운로드하지 못했습니다",
"modelDownload_incomplete": "불완전",
"modelDownload_verifying": "다운로드를 확인하는 중",
"modelDownload_useModel": "이 모델 사용",
"modelDownload_removeFailed": "모델을 제거하지 못했습니다: {error}",
"modelDownload_progress": "{current} / {total} MB ({percent}%)"
}
+56 -2
View File
@@ -1102,8 +1102,8 @@ abstract class AppLocalizations {
/// No description provided for @backupRestore_missingModelsMessage.
///
/// In en, this message translates to:
/// **'The restored settings select models that are not available on this device:\n{models}\n\nDownload them now?'**
String backupRestore_missingModelsMessage(String models);
/// **'The restored settings select models that are not on this device. Download them now?'**
String get backupRestore_missingModelsMessage;
/// No description provided for @backupRestore_downloadModels.
///
@@ -12633,6 +12633,60 @@ abstract class AppLocalizations {
/// In en, this message translates to:
/// **'Connect to a radio to send messages'**
String get chat_composerOffline;
/// No description provided for @modelDownload_notDownloaded.
///
/// In en, this message translates to:
/// **'Not downloaded'**
String get modelDownload_notDownloaded;
/// No description provided for @modelDownload_downloading.
///
/// In en, this message translates to:
/// **'Downloading'**
String get modelDownload_downloading;
/// No description provided for @modelDownload_active.
///
/// In en, this message translates to:
/// **'Active'**
String get modelDownload_active;
/// No description provided for @modelDownload_failed.
///
/// In en, this message translates to:
/// **'Couldn\'t download'**
String get modelDownload_failed;
/// No description provided for @modelDownload_incomplete.
///
/// In en, this message translates to:
/// **'Incomplete'**
String get modelDownload_incomplete;
/// No description provided for @modelDownload_verifying.
///
/// In en, this message translates to:
/// **'Verifying the download'**
String get modelDownload_verifying;
/// No description provided for @modelDownload_useModel.
///
/// In en, this message translates to:
/// **'Use this model'**
String get modelDownload_useModel;
/// No description provided for @modelDownload_removeFailed.
///
/// In en, this message translates to:
/// **'Couldn\'t remove the model: {error}'**
String modelDownload_removeFailed(String error);
/// No description provided for @modelDownload_progress.
///
/// In en, this message translates to:
/// **'{current} / {total} MB ({percent}%)'**
String modelDownload_progress(String current, String total, String percent);
}
class _AppLocalizationsDelegate
+33 -3
View File
@@ -557,9 +557,8 @@ class AppLocalizationsBg extends AppLocalizations {
String get backupRestore_missingModelsTitle => 'Моделите не са изтеглени';
@override
String backupRestore_missingModelsMessage(String models) {
return 'Възстановените настройки избират модели, които не са налични на това устройство:\n$models\n\nДа се изтеглят ли сега?';
}
String get backupRestore_missingModelsMessage =>
'Възстановените настройки избират модели, които не са налични на това устройство. Да се изтеглят ли сега?';
@override
String get backupRestore_downloadModels => 'Изтегли модели';
@@ -7582,4 +7581,35 @@ class AppLocalizationsBg extends AppLocalizations {
@override
String get chat_composerOffline =>
'Свържете се с радио, за да изпращате съобщения';
@override
String get modelDownload_notDownloaded => 'Не е изтеглен';
@override
String get modelDownload_downloading => 'Изтегляне';
@override
String get modelDownload_active => 'Активен';
@override
String get modelDownload_failed => 'Неуспешно изтегляне';
@override
String get modelDownload_incomplete => 'Непълен';
@override
String get modelDownload_verifying => 'Проверка на изтеглянето';
@override
String get modelDownload_useModel => 'Използвай този модел';
@override
String modelDownload_removeFailed(String error) {
return 'Моделът не можа да бъде премахнат: $error';
}
@override
String modelDownload_progress(String current, String total, String percent) {
return '$current / $total MB ($percent%)';
}
}
+33 -3
View File
@@ -551,9 +551,8 @@ class AppLocalizationsCs extends AppLocalizations {
String get backupRestore_missingModelsTitle => 'Modely nejsou stažené';
@override
String backupRestore_missingModelsMessage(String models) {
return 'Obnovené nastavení vybírá modely, které nejsou v tomto zařízení k dispozici:\n$models\n\nStáhnout je nyní?';
}
String get backupRestore_missingModelsMessage =>
'Obnovené nastavení vybírá modely, které nejsou v tomto zařízení k dispozici. Stáhnout je nyní?';
@override
String get backupRestore_downloadModels => 'Stáhnout modely';
@@ -7552,4 +7551,35 @@ class AppLocalizationsCs extends AppLocalizations {
@override
String get chat_composerOffline => 'Pro odesílání zpráv se připojte k rádiu';
@override
String get modelDownload_notDownloaded => 'Nestaženo';
@override
String get modelDownload_downloading => 'Stahování';
@override
String get modelDownload_active => 'Aktivní';
@override
String get modelDownload_failed => 'Stažení se nezdařilo';
@override
String get modelDownload_incomplete => 'Neúplné';
@override
String get modelDownload_verifying => 'Ověřování stažení';
@override
String get modelDownload_useModel => 'Použít tento model';
@override
String modelDownload_removeFailed(String error) {
return 'Model se nepodařilo odebrat: $error';
}
@override
String modelDownload_progress(String current, String total, String percent) {
return '$current / $total MB ($percent%)';
}
}
+33 -3
View File
@@ -559,9 +559,8 @@ class AppLocalizationsDe extends AppLocalizations {
'Modelle nicht heruntergeladen';
@override
String backupRestore_missingModelsMessage(String models) {
return 'Die wiederhergestellten Einstellungen wählen Modelle aus, die auf diesem Gerät nicht verfügbar sind:\n$models\n\nJetzt herunterladen?';
}
String get backupRestore_missingModelsMessage =>
'Die wiederhergestellten Einstellungen wählen Modelle aus, die auf diesem Gerät nicht verfügbar sind. Jetzt herunterladen?';
@override
String get backupRestore_downloadModels => 'Modelle herunterladen';
@@ -7597,4 +7596,35 @@ class AppLocalizationsDe extends AppLocalizations {
@override
String get chat_composerOffline =>
'Mit einem Funkgerät verbinden, um Nachrichten zu senden';
@override
String get modelDownload_notDownloaded => 'Nicht heruntergeladen';
@override
String get modelDownload_downloading => 'Wird heruntergeladen';
@override
String get modelDownload_active => 'Aktiv';
@override
String get modelDownload_failed => 'Download fehlgeschlagen';
@override
String get modelDownload_incomplete => 'Unvollständig';
@override
String get modelDownload_verifying => 'Download wird geprüft';
@override
String get modelDownload_useModel => 'Dieses Modell verwenden';
@override
String modelDownload_removeFailed(String error) {
return 'Das Modell konnte nicht entfernt werden: $error';
}
@override
String modelDownload_progress(String current, String total, String percent) {
return '$current / $total MB ($percent%)';
}
}
+33 -3
View File
@@ -547,9 +547,8 @@ class AppLocalizationsEn extends AppLocalizations {
String get backupRestore_missingModelsTitle => 'Models Not Downloaded';
@override
String backupRestore_missingModelsMessage(String models) {
return 'The restored settings select models that are not available on this device:\n$models\n\nDownload them now?';
}
String get backupRestore_missingModelsMessage =>
'The restored settings select models that are not on this device. Download them now?';
@override
String get backupRestore_downloadModels => 'Download Models';
@@ -7468,4 +7467,35 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get chat_composerOffline => 'Connect to a radio to send messages';
@override
String get modelDownload_notDownloaded => 'Not downloaded';
@override
String get modelDownload_downloading => 'Downloading';
@override
String get modelDownload_active => 'Active';
@override
String get modelDownload_failed => 'Couldn\'t download';
@override
String get modelDownload_incomplete => 'Incomplete';
@override
String get modelDownload_verifying => 'Verifying the download';
@override
String get modelDownload_useModel => 'Use this model';
@override
String modelDownload_removeFailed(String error) {
return 'Couldn\'t remove the model: $error';
}
@override
String modelDownload_progress(String current, String total, String percent) {
return '$current / $total MB ($percent%)';
}
}
+33 -3
View File
@@ -557,9 +557,8 @@ class AppLocalizationsEs extends AppLocalizations {
String get backupRestore_missingModelsTitle => 'Modelos no descargados';
@override
String backupRestore_missingModelsMessage(String models) {
return 'Los ajustes restaurados seleccionan modelos que no están disponibles en este dispositivo:\n$models\n\n¿Descargarlos ahora?';
}
String get backupRestore_missingModelsMessage =>
'Los ajustes restaurados seleccionan modelos que no están disponibles en este dispositivo. ¿Descargarlos ahora?';
@override
String get backupRestore_downloadModels => 'Descargar modelos';
@@ -7573,4 +7572,35 @@ class AppLocalizationsEs extends AppLocalizations {
@override
String get chat_composerOffline =>
'Conéctate a una radio para enviar mensajes';
@override
String get modelDownload_notDownloaded => 'No descargado';
@override
String get modelDownload_downloading => 'Descargando';
@override
String get modelDownload_active => 'Activo';
@override
String get modelDownload_failed => 'No se pudo descargar';
@override
String get modelDownload_incomplete => 'Incompleto';
@override
String get modelDownload_verifying => 'Comprobando la descarga';
@override
String get modelDownload_useModel => 'Usar este modelo';
@override
String modelDownload_removeFailed(String error) {
return 'No se pudo quitar el modelo: $error';
}
@override
String modelDownload_progress(String current, String total, String percent) {
return '$current / $total MB ($percent%)';
}
}
+33 -3
View File
@@ -556,9 +556,8 @@ class AppLocalizationsFr extends AppLocalizations {
String get backupRestore_missingModelsTitle => 'Modèles non téléchargés';
@override
String backupRestore_missingModelsMessage(String models) {
return 'Les réglages restaurés sélectionnent des modèles indisponibles sur cet appareil :\n$models\n\nLes télécharger maintenant ?';
}
String get backupRestore_missingModelsMessage =>
'Les réglages restaurés sélectionnent des modèles indisponibles sur cet appareil. Les télécharger maintenant ?';
@override
String get backupRestore_downloadModels => 'Télécharger les modèles';
@@ -7602,4 +7601,35 @@ class AppLocalizationsFr extends AppLocalizations {
@override
String get chat_composerOffline =>
'Connectez-vous à une radio pour envoyer des messages';
@override
String get modelDownload_notDownloaded => 'Non téléchargé';
@override
String get modelDownload_downloading => 'Téléchargement';
@override
String get modelDownload_active => 'Actif';
@override
String get modelDownload_failed => 'Échec du téléchargement';
@override
String get modelDownload_incomplete => 'Incomplet';
@override
String get modelDownload_verifying => 'Vérification du téléchargement';
@override
String get modelDownload_useModel => 'Utiliser ce modèle';
@override
String modelDownload_removeFailed(String error) {
return 'Impossible de retirer le modèle : $error';
}
@override
String modelDownload_progress(String current, String total, String percent) {
return '$current / $total MB ($percent%)';
}
}
+33 -3
View File
@@ -552,9 +552,8 @@ class AppLocalizationsHu extends AppLocalizations {
'A modellek nincsenek letöltve';
@override
String backupRestore_missingModelsMessage(String models) {
return 'A visszaállított beállítások olyan modelleket választanak, amelyek nem érhetők el ezen az eszközön:\n$models\n\nLetölti őket most?';
}
String get backupRestore_missingModelsMessage =>
'A visszaállított beállítások olyan modelleket választanak, amelyek nem érhetők el ezen az eszközön. Letölti őket most?';
@override
String get backupRestore_downloadModels => 'Modellek letöltése';
@@ -7565,4 +7564,35 @@ class AppLocalizationsHu extends AppLocalizations {
@override
String get chat_composerOffline => 'Üzenetküldéshez csatlakozzon rádióhoz';
@override
String get modelDownload_notDownloaded => 'Nincs letöltve';
@override
String get modelDownload_downloading => 'Letöltés';
@override
String get modelDownload_active => 'Aktív';
@override
String get modelDownload_failed => 'A letöltés sikertelen';
@override
String get modelDownload_incomplete => 'Hiányos';
@override
String get modelDownload_verifying => 'A letöltés ellenőrzése';
@override
String get modelDownload_useModel => 'Ezt a modellt használja';
@override
String modelDownload_removeFailed(String error) {
return 'A modellt nem sikerült eltávolítani: $error';
}
@override
String modelDownload_progress(String current, String total, String percent) {
return '$current / $total MB ($percent%)';
}
}
+33 -3
View File
@@ -556,9 +556,8 @@ class AppLocalizationsIt extends AppLocalizations {
String get backupRestore_missingModelsTitle => 'Modelli non scaricati';
@override
String backupRestore_missingModelsMessage(String models) {
return 'Le impostazioni ripristinate selezionano modelli non disponibili su questo dispositivo:\n$models\n\nScaricarli ora?';
}
String get backupRestore_missingModelsMessage =>
'Le impostazioni ripristinate selezionano modelli non disponibili su questo dispositivo. Scaricarli ora?';
@override
String get backupRestore_downloadModels => 'Scarica modelli';
@@ -7585,4 +7584,35 @@ class AppLocalizationsIt extends AppLocalizations {
@override
String get chat_composerOffline =>
'Connettiti a una radio per inviare messaggi';
@override
String get modelDownload_notDownloaded => 'Non scaricato';
@override
String get modelDownload_downloading => 'Download in corso';
@override
String get modelDownload_active => 'Attivo';
@override
String get modelDownload_failed => 'Download non riuscito';
@override
String get modelDownload_incomplete => 'Incompleto';
@override
String get modelDownload_verifying => 'Verifica del download';
@override
String get modelDownload_useModel => 'Usa questo modello';
@override
String modelDownload_removeFailed(String error) {
return 'Impossibile rimuovere il modello: $error';
}
@override
String modelDownload_progress(String current, String total, String percent) {
return '$current / $total MB ($percent%)';
}
}
+33 -3
View File
@@ -531,9 +531,8 @@ class AppLocalizationsJa extends AppLocalizations {
String get backupRestore_missingModelsTitle => 'モデル未ダウンロード';
@override
String backupRestore_missingModelsMessage(String models) {
return '復元された設定で選択されているモデルが、このデバイスにありません:\n$models\n\n今すぐダウンロードしますか?';
}
String get backupRestore_missingModelsMessage =>
'復元された設定で選択されているモデルが、このデバイスにありません。今すぐダウンロードしますか?';
@override
String get backupRestore_downloadModels => 'モデルをダウンロード';
@@ -7227,4 +7226,35 @@ class AppLocalizationsJa extends AppLocalizations {
@override
String get chat_composerOffline => 'メッセージを送信するには無線機に接続してください';
@override
String get modelDownload_notDownloaded => '未ダウンロード';
@override
String get modelDownload_downloading => 'ダウンロード中';
@override
String get modelDownload_active => '使用中';
@override
String get modelDownload_failed => 'ダウンロードできませんでした';
@override
String get modelDownload_incomplete => '未完了';
@override
String get modelDownload_verifying => 'ダウンロードを確認しています';
@override
String get modelDownload_useModel => 'このモデルを使う';
@override
String modelDownload_removeFailed(String error) {
return 'モデルを削除できませんでした: $error';
}
@override
String modelDownload_progress(String current, String total, String percent) {
return '$current / $total MB ($percent%)';
}
}
+33 -3
View File
@@ -531,9 +531,8 @@ class AppLocalizationsKo extends AppLocalizations {
String get backupRestore_missingModelsTitle => '모델이 다운로드되지 않음';
@override
String backupRestore_missingModelsMessage(String models) {
return '복원된 설정에서 선택한 모델이 이 기기에 없습니다:\n$models\n\n지금 다운로드할까요?';
}
String get backupRestore_missingModelsMessage =>
'복원된 설정에서 선택한 모델이 이 기기에 없습니다. 지금 다운로드할까요?';
@override
String get backupRestore_downloadModels => '모델 다운로드';
@@ -7240,4 +7239,35 @@ class AppLocalizationsKo extends AppLocalizations {
@override
String get chat_composerOffline => '메시지를 보내려면 무전기에 연결하세요';
@override
String get modelDownload_notDownloaded => '다운로드되지 않음';
@override
String get modelDownload_downloading => '다운로드 중';
@override
String get modelDownload_active => '사용 중';
@override
String get modelDownload_failed => '다운로드하지 못했습니다';
@override
String get modelDownload_incomplete => '불완전';
@override
String get modelDownload_verifying => '다운로드를 확인하는 중';
@override
String get modelDownload_useModel => '이 모델 사용';
@override
String modelDownload_removeFailed(String error) {
return '모델을 제거하지 못했습니다: $error';
}
@override
String modelDownload_progress(String current, String total, String percent) {
return '$current / $total MB ($percent%)';
}
}
+33 -3
View File
@@ -552,9 +552,8 @@ class AppLocalizationsNl extends AppLocalizations {
String get backupRestore_missingModelsTitle => 'Modellen niet gedownload';
@override
String backupRestore_missingModelsMessage(String models) {
return 'De herstelde instellingen selecteren modellen die op dit apparaat niet beschikbaar zijn:\n$models\n\nNu downloaden?';
}
String get backupRestore_missingModelsMessage =>
'De herstelde instellingen selecteren modellen die op dit apparaat niet beschikbaar zijn. Nu downloaden?';
@override
String get backupRestore_downloadModels => 'Modellen downloaden';
@@ -7541,4 +7540,35 @@ class AppLocalizationsNl extends AppLocalizations {
@override
String get chat_composerOffline =>
'Verbind met een radio om berichten te versturen';
@override
String get modelDownload_notDownloaded => 'Niet gedownload';
@override
String get modelDownload_downloading => 'Downloaden';
@override
String get modelDownload_active => 'Actief';
@override
String get modelDownload_failed => 'Downloaden mislukt';
@override
String get modelDownload_incomplete => 'Onvolledig';
@override
String get modelDownload_verifying => 'Download controleren';
@override
String get modelDownload_useModel => 'Dit model gebruiken';
@override
String modelDownload_removeFailed(String error) {
return 'Het model kon niet worden verwijderd: $error';
}
@override
String modelDownload_progress(String current, String total, String percent) {
return '$current / $total MB ($percent%)';
}
}
+33 -3
View File
@@ -560,9 +560,8 @@ class AppLocalizationsPl extends AppLocalizations {
String get backupRestore_missingModelsTitle => 'Modele nie zostały pobrane';
@override
String backupRestore_missingModelsMessage(String models) {
return 'Przywrócone ustawienia wybierają modele, które nie są dostępne na tym urządzeniu:\n$models\n\nPobrać je teraz?';
}
String get backupRestore_missingModelsMessage =>
'Przywrócone ustawienia wybierają modele, które nie są dostępne na tym urządzeniu. Pobrać je teraz?';
@override
String get backupRestore_downloadModels => 'Pobierz modele';
@@ -7619,4 +7618,35 @@ class AppLocalizationsPl extends AppLocalizations {
@override
String get chat_composerOffline =>
'Połącz się z radiem, aby wysyłać wiadomości';
@override
String get modelDownload_notDownloaded => 'Nie pobrano';
@override
String get modelDownload_downloading => 'Pobieranie';
@override
String get modelDownload_active => 'Aktywny';
@override
String get modelDownload_failed => 'Nie udało się pobrać';
@override
String get modelDownload_incomplete => 'Niekompletny';
@override
String get modelDownload_verifying => 'Sprawdzanie pobierania';
@override
String get modelDownload_useModel => 'Użyj tego modelu';
@override
String modelDownload_removeFailed(String error) {
return 'Nie udało się usunąć modelu: $error';
}
@override
String modelDownload_progress(String current, String total, String percent) {
return '$current / $total MB ($percent%)';
}
}
+66 -6
View File
@@ -557,9 +557,8 @@ class AppLocalizationsPt extends AppLocalizations {
String get backupRestore_missingModelsTitle => 'Modelos não baixados';
@override
String backupRestore_missingModelsMessage(String models) {
return 'As configurações restauradas selecionam modelos que não estão disponíveis neste dispositivo:\n$models\n\nBaixar agora?';
}
String get backupRestore_missingModelsMessage =>
'As configurações restauradas selecionam modelos que não estão disponíveis neste dispositivo. Baixar agora?';
@override
String get backupRestore_downloadModels => 'Baixar modelos';
@@ -7563,6 +7562,37 @@ class AppLocalizationsPt extends AppLocalizations {
@override
String get chat_composerOffline =>
'Conecte-se a um rádio para enviar mensagens';
@override
String get modelDownload_notDownloaded => 'Não baixado';
@override
String get modelDownload_downloading => 'Baixando';
@override
String get modelDownload_active => 'Ativo';
@override
String get modelDownload_failed => 'Não foi possível baixar';
@override
String get modelDownload_incomplete => 'Incompleto';
@override
String get modelDownload_verifying => 'Verificando o download';
@override
String get modelDownload_useModel => 'Usar este modelo';
@override
String modelDownload_removeFailed(String error) {
return 'Não foi possível remover o modelo: $error';
}
@override
String modelDownload_progress(String current, String total, String percent) {
return '$current / $total MB ($percent%)';
}
}
/// The translations for Portuguese, as used in Portugal (`pt_PT`).
@@ -8112,9 +8142,8 @@ class AppLocalizationsPtPt extends AppLocalizationsPt {
String get backupRestore_missingModelsTitle => 'Modelos não transferidos';
@override
String backupRestore_missingModelsMessage(String models) {
return 'As definições restauradas selecionam modelos que não estão disponíveis neste dispositivo:\n$models\n\nTransferi-los agora?';
}
String get backupRestore_missingModelsMessage =>
'As definições restauradas selecionam modelos que não estão disponíveis neste dispositivo. Transferi-los agora?';
@override
String get backupRestore_downloadModels => 'Transferir modelos';
@@ -15015,4 +15044,35 @@ class AppLocalizationsPtPt extends AppLocalizationsPt {
@override
String get chat_composerOffline =>
'Ligue-se a um rádio para enviar mensagens';
@override
String get modelDownload_notDownloaded => 'Não transferido';
@override
String get modelDownload_downloading => 'A transferir';
@override
String get modelDownload_active => 'Ativo';
@override
String get modelDownload_failed => 'Não foi possível transferir';
@override
String get modelDownload_incomplete => 'Incompleto';
@override
String get modelDownload_verifying => 'A verificar a transferência';
@override
String get modelDownload_useModel => 'Utilizar este modelo';
@override
String modelDownload_removeFailed(String error) {
return 'Não foi possível remover o modelo: $error';
}
@override
String modelDownload_progress(String current, String total, String percent) {
return '$current / $total MB ($percent%)';
}
}
+33 -3
View File
@@ -554,9 +554,8 @@ class AppLocalizationsRu extends AppLocalizations {
String get backupRestore_missingModelsTitle => 'Модели не загружены';
@override
String backupRestore_missingModelsMessage(String models) {
return 'Восстановленные настройки выбирают модели, которых нет на этом устройстве:\n$models\n\nЗагрузить их сейчас?';
}
String get backupRestore_missingModelsMessage =>
'Восстановленные настройки выбирают модели, которых нет на этом устройстве. Загрузить их сейчас?';
@override
String get backupRestore_downloadModels => 'Загрузить модели';
@@ -7599,4 +7598,35 @@ class AppLocalizationsRu extends AppLocalizations {
@override
String get chat_composerOffline =>
'Подключитесь к радио, чтобы отправлять сообщения';
@override
String get modelDownload_notDownloaded => 'Не скачано';
@override
String get modelDownload_downloading => 'Загрузка';
@override
String get modelDownload_active => 'Активна';
@override
String get modelDownload_failed => 'Не удалось скачать';
@override
String get modelDownload_incomplete => 'Неполная';
@override
String get modelDownload_verifying => 'Проверка загрузки';
@override
String get modelDownload_useModel => 'Использовать эту модель';
@override
String modelDownload_removeFailed(String error) {
return 'Не удалось удалить модель: $error';
}
@override
String modelDownload_progress(String current, String total, String percent) {
return '$current / $total MB ($percent%)';
}
}
+33 -3
View File
@@ -555,9 +555,8 @@ class AppLocalizationsSk extends AppLocalizations {
String get backupRestore_missingModelsTitle => 'Modely nie sú stiahnuté';
@override
String backupRestore_missingModelsMessage(String models) {
return 'Obnovené nastavenia vyberajú modely, ktoré nie sú v tomto zariadení k dispozícii:\n$models\n\nStiahnuť ich teraz?';
}
String get backupRestore_missingModelsMessage =>
'Obnovené nastavenia vyberajú modely, ktoré nie sú v tomto zariadení k dispozícii. Stiahnuť ich teraz?';
@override
String get backupRestore_downloadModels => 'Stiahnuť modely';
@@ -7564,4 +7563,35 @@ class AppLocalizationsSk extends AppLocalizations {
@override
String get chat_composerOffline => 'Na odosielanie správ sa pripojte k rádiu';
@override
String get modelDownload_notDownloaded => 'Nestiahnuté';
@override
String get modelDownload_downloading => 'Sťahovanie';
@override
String get modelDownload_active => 'Aktívny';
@override
String get modelDownload_failed => 'Sťahovanie zlyhalo';
@override
String get modelDownload_incomplete => 'Nekompletné';
@override
String get modelDownload_verifying => 'Overuje sa sťahovanie';
@override
String get modelDownload_useModel => 'Použiť tento model';
@override
String modelDownload_removeFailed(String error) {
return 'Model sa nepodarilo odstrániť: $error';
}
@override
String modelDownload_progress(String current, String total, String percent) {
return '$current / $total MB ($percent%)';
}
}
+33 -3
View File
@@ -554,9 +554,8 @@ class AppLocalizationsSl extends AppLocalizations {
String get backupRestore_missingModelsTitle => 'Modeli niso preneseni';
@override
String backupRestore_missingModelsMessage(String models) {
return 'Obnovljene nastavitve izbirajo modele, ki niso na voljo v tej napravi:\n$models\n\nJih želite prenesti zdaj?';
}
String get backupRestore_missingModelsMessage =>
'Obnovljene nastavitve izbirajo modele, ki niso na voljo v tej napravi. Jih želite prenesti zdaj?';
@override
String get backupRestore_downloadModels => 'Prenesi modele';
@@ -7558,4 +7557,35 @@ class AppLocalizationsSl extends AppLocalizations {
@override
String get chat_composerOffline =>
'Za pošiljanje sporočil se povežite z radiem';
@override
String get modelDownload_notDownloaded => 'Ni preneseno';
@override
String get modelDownload_downloading => 'Prenašanje';
@override
String get modelDownload_active => 'Aktiven';
@override
String get modelDownload_failed => 'Prenos ni uspel';
@override
String get modelDownload_incomplete => 'Nepopolno';
@override
String get modelDownload_verifying => 'Preverjanje prenosa';
@override
String get modelDownload_useModel => 'Uporabi ta model';
@override
String modelDownload_removeFailed(String error) {
return 'Modela ni bilo mogoče odstraniti: $error';
}
@override
String modelDownload_progress(String current, String total, String percent) {
return '$current / $total MB ($percent%)';
}
}
+33 -3
View File
@@ -553,9 +553,8 @@ class AppLocalizationsSv extends AppLocalizations {
String get backupRestore_missingModelsTitle => 'Modeller inte nedladdade';
@override
String backupRestore_missingModelsMessage(String models) {
return 'De återställda inställningarna väljer modeller som inte finns på den här enheten:\n$models\n\nLadda ned dem nu?';
}
String get backupRestore_missingModelsMessage =>
'De återställda inställningarna väljer modeller som inte finns på den här enheten. Ladda ned dem nu?';
@override
String get backupRestore_downloadModels => 'Ladda ned modeller';
@@ -7518,4 +7517,35 @@ class AppLocalizationsSv extends AppLocalizations {
@override
String get chat_composerOffline =>
'Anslut till en radio för att skicka meddelanden';
@override
String get modelDownload_notDownloaded => 'Inte nedladdad';
@override
String get modelDownload_downloading => 'Laddar ner';
@override
String get modelDownload_active => 'Aktiv';
@override
String get modelDownload_failed => 'Kunde inte ladda ner';
@override
String get modelDownload_incomplete => 'Ofullständig';
@override
String get modelDownload_verifying => 'Verifierar nedladdningen';
@override
String get modelDownload_useModel => 'Använd den här modellen';
@override
String modelDownload_removeFailed(String error) {
return 'Det gick inte att ta bort modellen: $error';
}
@override
String modelDownload_progress(String current, String total, String percent) {
return '$current / $total MB ($percent%)';
}
}
+33 -3
View File
@@ -553,9 +553,8 @@ class AppLocalizationsUk extends AppLocalizations {
String get backupRestore_missingModelsTitle => 'Моделі не завантажено';
@override
String backupRestore_missingModelsMessage(String models) {
return 'Відновлені налаштування вибирають моделі, яких немає на цьому пристрої:\n$models\n\nЗавантажити їх зараз?';
}
String get backupRestore_missingModelsMessage =>
'Відновлені налаштування вибирають моделі, яких немає на цьому пристрої. Завантажити їх зараз?';
@override
String get backupRestore_downloadModels => 'Завантажити моделі';
@@ -7611,4 +7610,35 @@ class AppLocalizationsUk extends AppLocalizations {
@override
String get chat_composerOffline =>
'Підключіться до радіо, щоб надсилати повідомлення';
@override
String get modelDownload_notDownloaded => 'Не завантажено';
@override
String get modelDownload_downloading => 'Завантаження';
@override
String get modelDownload_active => 'Активна';
@override
String get modelDownload_failed => 'Не вдалося завантажити';
@override
String get modelDownload_incomplete => 'Неповна';
@override
String get modelDownload_verifying => 'Перевірка завантаження';
@override
String get modelDownload_useModel => 'Використовувати цю модель';
@override
String modelDownload_removeFailed(String error) {
return 'Не вдалося видалити модель: $error';
}
@override
String modelDownload_progress(String current, String total, String percent) {
return '$current / $total MB ($percent%)';
}
}
+32 -3
View File
@@ -520,9 +520,7 @@ class AppLocalizationsZh extends AppLocalizations {
String get backupRestore_missingModelsTitle => '模型未下载';
@override
String backupRestore_missingModelsMessage(String models) {
return '恢复的设置所选用的模型在此设备上不可用:\n$models\n\n现在下载吗?';
}
String get backupRestore_missingModelsMessage => '恢复的设置所选用的模型在此设备上不可用。现在下载吗?';
@override
String get backupRestore_downloadModels => '下载模型';
@@ -7070,4 +7068,35 @@ class AppLocalizationsZh extends AppLocalizations {
@override
String get chat_composerOffline => '连接到无线电后才能发送消息';
@override
String get modelDownload_notDownloaded => '未下载';
@override
String get modelDownload_downloading => '正在下载';
@override
String get modelDownload_active => '当前使用';
@override
String get modelDownload_failed => '下载失败';
@override
String get modelDownload_incomplete => '不完整';
@override
String get modelDownload_verifying => '正在校验下载';
@override
String get modelDownload_useModel => '使用此模型';
@override
String modelDownload_removeFailed(String error) {
return '无法移除模型:$error';
}
@override
String modelDownload_progress(String current, String total, String percent) {
return '$current / $total MB ($percent%)';
}
}
+11 -2
View File
@@ -3657,7 +3657,7 @@
"backupRestore_backupComplete": "Back-upbestand gemaakt.",
"backupRestore_restoreComplete": "Herstel voltooid. Verbind opnieuw als je de radio-identiteit hebt hersteld.",
"backupRestore_missingModelsTitle": "Modellen niet gedownload",
"backupRestore_missingModelsMessage": "De herstelde instellingen selecteren modellen die op dit apparaat niet beschikbaar zijn:\n{models}\n\nNu downloaden?",
"backupRestore_missingModelsMessage": "De herstelde instellingen selecteren modellen die op dit apparaat niet beschikbaar zijn. Nu downloaden?",
"backupRestore_downloadModels": "Modellen downloaden",
"backupRestore_downloading": "Downloaden…",
"backupRestore_cancelDownload": "Download annuleren",
@@ -3677,5 +3677,14 @@
"connectSheet_chooseRadioSubtitle": "Bluetooth, USB of TCP",
"connectSheet_stopReconnecting": "Opnieuw verbinden stoppen",
"connectSheet_reconnectFailed": "Kan {name} niet bereiken. Controleer of het aan staat en in de buurt is.",
"chat_composerOffline": "Verbind met een radio om berichten te versturen"
"chat_composerOffline": "Verbind met een radio om berichten te versturen",
"modelDownload_notDownloaded": "Niet gedownload",
"modelDownload_downloading": "Downloaden",
"modelDownload_active": "Actief",
"modelDownload_failed": "Downloaden mislukt",
"modelDownload_incomplete": "Onvolledig",
"modelDownload_verifying": "Download controleren",
"modelDownload_useModel": "Dit model gebruiken",
"modelDownload_removeFailed": "Het model kon niet worden verwijderd: {error}",
"modelDownload_progress": "{current} / {total} MB ({percent}%)"
}
+11 -2
View File
@@ -3995,7 +3995,7 @@
"backupRestore_backupComplete": "Plik kopii zapasowej został utworzony.",
"backupRestore_restoreComplete": "Przywracanie zakończone. Połącz się ponownie, jeśli przywrócono tożsamość radia.",
"backupRestore_missingModelsTitle": "Modele nie zostały pobrane",
"backupRestore_missingModelsMessage": "Przywrócone ustawienia wybierają modele, które nie są dostępne na tym urządzeniu:\n{models}\n\nPobrać je teraz?",
"backupRestore_missingModelsMessage": "Przywrócone ustawienia wybierają modele, które nie są dostępne na tym urządzeniu. Pobrać je teraz?",
"backupRestore_downloadModels": "Pobierz modele",
"backupRestore_downloading": "Pobieranie…",
"backupRestore_cancelDownload": "Anuluj pobieranie",
@@ -4015,5 +4015,14 @@
"connectSheet_chooseRadioSubtitle": "Bluetooth, USB lub TCP",
"connectSheet_stopReconnecting": "Zatrzymaj ponowne łączenie",
"connectSheet_reconnectFailed": "Nie można połączyć z {name}. Upewnij się, że jest włączone i w pobliżu.",
"chat_composerOffline": "Połącz się z radiem, aby wysyłać wiadomości"
"chat_composerOffline": "Połącz się z radiem, aby wysyłać wiadomości",
"modelDownload_notDownloaded": "Nie pobrano",
"modelDownload_downloading": "Pobieranie",
"modelDownload_active": "Aktywny",
"modelDownload_failed": "Nie udało się pobrać",
"modelDownload_incomplete": "Niekompletny",
"modelDownload_verifying": "Sprawdzanie pobierania",
"modelDownload_useModel": "Użyj tego modelu",
"modelDownload_removeFailed": "Nie udało się usunąć modelu: {error}",
"modelDownload_progress": "{current} / {total} MB ({percent}%)"
}
+11 -2
View File
@@ -3808,7 +3808,7 @@
"backupRestore_backupComplete": "Arquivo de backup criado.",
"backupRestore_restoreComplete": "Restauração concluída. Reconecte se você restaurou a identidade do rádio.",
"backupRestore_missingModelsTitle": "Modelos não baixados",
"backupRestore_missingModelsMessage": "As configurações restauradas selecionam modelos que não estão disponíveis neste dispositivo:\n{models}\n\nBaixar agora?",
"backupRestore_missingModelsMessage": "As configurações restauradas selecionam modelos que não estão disponíveis neste dispositivo. Baixar agora?",
"backupRestore_downloadModels": "Baixar modelos",
"backupRestore_downloading": "Baixando…",
"backupRestore_cancelDownload": "Cancelar download",
@@ -3828,5 +3828,14 @@
"connectSheet_chooseRadioSubtitle": "Bluetooth, USB ou TCP",
"connectSheet_stopReconnecting": "Parar de reconectar",
"connectSheet_reconnectFailed": "Não foi possível alcançar {name}. Verifique se está ligado e por perto.",
"chat_composerOffline": "Conecte-se a um rádio para enviar mensagens"
"chat_composerOffline": "Conecte-se a um rádio para enviar mensagens",
"modelDownload_notDownloaded": "Não baixado",
"modelDownload_downloading": "Baixando",
"modelDownload_active": "Ativo",
"modelDownload_failed": "Não foi possível baixar",
"modelDownload_incomplete": "Incompleto",
"modelDownload_verifying": "Verificando o download",
"modelDownload_useModel": "Usar este modelo",
"modelDownload_removeFailed": "Não foi possível remover o modelo: {error}",
"modelDownload_progress": "{current} / {total} MB ({percent}%)"
}
+11 -2
View File
@@ -160,7 +160,7 @@
"backupRestore_backupComplete": "Ficheiro de cópia criado.",
"backupRestore_restoreComplete": "Restauro concluído. Volte a ligar se restaurou a identidade do rádio.",
"backupRestore_missingModelsTitle": "Modelos não transferidos",
"backupRestore_missingModelsMessage": "As definições restauradas selecionam modelos que não estão disponíveis neste dispositivo:\n{models}\n\nTransferi-los agora?",
"backupRestore_missingModelsMessage": "As definições restauradas selecionam modelos que não estão disponíveis neste dispositivo. Transferi-los agora?",
"backupRestore_downloadModels": "Transferir modelos",
"backupRestore_downloading": "A transferir…",
"backupRestore_cancelDownload": "Cancelar transferência",
@@ -2055,5 +2055,14 @@
"connectSheet_chooseRadioSubtitle": "Bluetooth, USB ou TCP",
"connectSheet_stopReconnecting": "Parar de religar",
"connectSheet_reconnectFailed": "Não foi possível contactar {name}. Verifique se está ligado e por perto.",
"chat_composerOffline": "Ligue-se a um rádio para enviar mensagens"
"chat_composerOffline": "Ligue-se a um rádio para enviar mensagens",
"modelDownload_notDownloaded": "Não transferido",
"modelDownload_downloading": "A transferir",
"modelDownload_active": "Ativo",
"modelDownload_failed": "Não foi possível transferir",
"modelDownload_incomplete": "Incompleto",
"modelDownload_verifying": "A verificar a transferência",
"modelDownload_useModel": "Utilizar este modelo",
"modelDownload_removeFailed": "Não foi possível remover o modelo: {error}",
"modelDownload_progress": "{current} / {total} MB ({percent}%)"
}
+11 -2
View File
@@ -3053,7 +3053,7 @@
"backupRestore_backupComplete": "Файл резервной копии создан.",
"backupRestore_restoreComplete": "Восстановление завершено. Переподключитесь, если вы восстановили идентификатор радио.",
"backupRestore_missingModelsTitle": "Модели не загружены",
"backupRestore_missingModelsMessage": "Восстановленные настройки выбирают модели, которых нет на этом устройстве:\n{models}\n\nЗагрузить их сейчас?",
"backupRestore_missingModelsMessage": "Восстановленные настройки выбирают модели, которых нет на этом устройстве. Загрузить их сейчас?",
"backupRestore_downloadModels": "Загрузить модели",
"backupRestore_downloading": "Загрузка…",
"backupRestore_cancelDownload": "Отменить загрузку",
@@ -3073,5 +3073,14 @@
"connectSheet_chooseRadioSubtitle": "Bluetooth, USB или TCP",
"connectSheet_stopReconnecting": "Остановить переподключение",
"connectSheet_reconnectFailed": "Не удалось связаться с {name}. Убедитесь, что оно включено и находится рядом.",
"chat_composerOffline": "Подключитесь к радио, чтобы отправлять сообщения"
"chat_composerOffline": "Подключитесь к радио, чтобы отправлять сообщения",
"modelDownload_notDownloaded": "Не скачано",
"modelDownload_downloading": "Загрузка",
"modelDownload_active": "Активна",
"modelDownload_failed": "Не удалось скачать",
"modelDownload_incomplete": "Неполная",
"modelDownload_verifying": "Проверка загрузки",
"modelDownload_useModel": "Использовать эту модель",
"modelDownload_removeFailed": "Не удалось удалить модель: {error}",
"modelDownload_progress": "{current} / {total} MB ({percent}%)"
}
+11 -2
View File
@@ -3809,7 +3809,7 @@
"backupRestore_backupComplete": "Súbor zálohy bol vytvorený.",
"backupRestore_restoreComplete": "Obnovenie dokončené. Ak ste obnovili identitu rádia, pripojte sa znova.",
"backupRestore_missingModelsTitle": "Modely nie sú stiahnuté",
"backupRestore_missingModelsMessage": "Obnovené nastavenia vyberajú modely, ktoré nie sú v tomto zariadení k dispozícii:\n{models}\n\nStiahnuť ich teraz?",
"backupRestore_missingModelsMessage": "Obnovené nastavenia vyberajú modely, ktoré nie sú v tomto zariadení k dispozícii. Stiahnuť ich teraz?",
"backupRestore_downloadModels": "Stiahnuť modely",
"backupRestore_downloading": "Sťahovanie…",
"backupRestore_cancelDownload": "Zrušiť sťahovanie",
@@ -3829,5 +3829,14 @@
"connectSheet_chooseRadioSubtitle": "Bluetooth, USB alebo TCP",
"connectSheet_stopReconnecting": "Zastaviť pripájanie",
"connectSheet_reconnectFailed": "Nedá sa spojiť s {name}. Uistite sa, že je zapnuté a nablízku.",
"chat_composerOffline": "Na odosielanie správ sa pripojte k rádiu"
"chat_composerOffline": "Na odosielanie správ sa pripojte k rádiu",
"modelDownload_notDownloaded": "Nestiahnuté",
"modelDownload_downloading": "Sťahovanie",
"modelDownload_active": "Aktívny",
"modelDownload_failed": "Sťahovanie zlyhalo",
"modelDownload_incomplete": "Nekompletné",
"modelDownload_verifying": "Overuje sa sťahovanie",
"modelDownload_useModel": "Použiť tento model",
"modelDownload_removeFailed": "Model sa nepodarilo odstrániť: {error}",
"modelDownload_progress": "{current} / {total} MB ({percent}%)"
}
+11 -2
View File
@@ -3963,7 +3963,7 @@
"backupRestore_backupComplete": "Datoteka varnostne kopije je ustvarjena.",
"backupRestore_restoreComplete": "Obnovitev je končana. Če ste obnovili identiteto radia, se znova povežite.",
"backupRestore_missingModelsTitle": "Modeli niso preneseni",
"backupRestore_missingModelsMessage": "Obnovljene nastavitve izbirajo modele, ki niso na voljo v tej napravi:\n{models}\n\nJih želite prenesti zdaj?",
"backupRestore_missingModelsMessage": "Obnovljene nastavitve izbirajo modele, ki niso na voljo v tej napravi. Jih želite prenesti zdaj?",
"backupRestore_downloadModels": "Prenesi modele",
"backupRestore_downloading": "Prenašanje…",
"backupRestore_cancelDownload": "Prekliči prenos",
@@ -3983,5 +3983,14 @@
"connectSheet_chooseRadioSubtitle": "Bluetooth, USB ali TCP",
"connectSheet_stopReconnecting": "Ustavi ponovno povezovanje",
"connectSheet_reconnectFailed": "Ni mogoče doseči {name}. Preverite, ali je vklopljen in v bližini.",
"chat_composerOffline": "Za pošiljanje sporočil se povežite z radiem"
"chat_composerOffline": "Za pošiljanje sporočil se povežite z radiem",
"modelDownload_notDownloaded": "Ni preneseno",
"modelDownload_downloading": "Prenašanje",
"modelDownload_active": "Aktiven",
"modelDownload_failed": "Prenos ni uspel",
"modelDownload_incomplete": "Nepopolno",
"modelDownload_verifying": "Preverjanje prenosa",
"modelDownload_useModel": "Uporabi ta model",
"modelDownload_removeFailed": "Modela ni bilo mogoče odstraniti: {error}",
"modelDownload_progress": "{current} / {total} MB ({percent}%)"
}
+11 -2
View File
@@ -3803,7 +3803,7 @@
"backupRestore_backupComplete": "Säkerhetskopia skapad.",
"backupRestore_restoreComplete": "Återställningen är klar. Återanslut om du återställde radions identitet.",
"backupRestore_missingModelsTitle": "Modeller inte nedladdade",
"backupRestore_missingModelsMessage": "De återställda inställningarna väljer modeller som inte finns på den här enheten:\n{models}\n\nLadda ned dem nu?",
"backupRestore_missingModelsMessage": "De återställda inställningarna väljer modeller som inte finns på den här enheten. Ladda ned dem nu?",
"backupRestore_downloadModels": "Ladda ned modeller",
"backupRestore_downloading": "Laddar ned…",
"backupRestore_cancelDownload": "Avbryt nedladdning",
@@ -3823,5 +3823,14 @@
"connectSheet_chooseRadioSubtitle": "Bluetooth, USB eller TCP",
"connectSheet_stopReconnecting": "Sluta återansluta",
"connectSheet_reconnectFailed": "Kunde inte nå {name}. Kontrollera att den är påslagen och i närheten.",
"chat_composerOffline": "Anslut till en radio för att skicka meddelanden"
"chat_composerOffline": "Anslut till en radio för att skicka meddelanden",
"modelDownload_notDownloaded": "Inte nedladdad",
"modelDownload_downloading": "Laddar ner",
"modelDownload_active": "Aktiv",
"modelDownload_failed": "Kunde inte ladda ner",
"modelDownload_incomplete": "Ofullständig",
"modelDownload_verifying": "Verifierar nedladdningen",
"modelDownload_useModel": "Använd den här modellen",
"modelDownload_removeFailed": "Det gick inte att ta bort modellen: {error}",
"modelDownload_progress": "{current} / {total} MB ({percent}%)"
}
+11 -2
View File
@@ -3736,7 +3736,7 @@
"backupRestore_backupComplete": "Файл резервної копії створено.",
"backupRestore_restoreComplete": "Відновлення завершено. Перепідключіться, якщо ви відновили ідентифікатор радіо.",
"backupRestore_missingModelsTitle": "Моделі не завантажено",
"backupRestore_missingModelsMessage": "Відновлені налаштування вибирають моделі, яких немає на цьому пристрої:\n{models}\n\nЗавантажити їх зараз?",
"backupRestore_missingModelsMessage": "Відновлені налаштування вибирають моделі, яких немає на цьому пристрої. Завантажити їх зараз?",
"backupRestore_downloadModels": "Завантажити моделі",
"backupRestore_downloading": "Завантаження…",
"backupRestore_cancelDownload": "Скасувати завантаження",
@@ -3756,5 +3756,14 @@
"connectSheet_chooseRadioSubtitle": "Bluetooth, USB або TCP",
"connectSheet_stopReconnecting": "Зупинити перепідключення",
"connectSheet_reconnectFailed": "Не вдалося зв'язатися з {name}. Переконайтеся, що воно увімкнене й поруч.",
"chat_composerOffline": "Підключіться до радіо, щоб надсилати повідомлення"
"chat_composerOffline": "Підключіться до радіо, щоб надсилати повідомлення",
"modelDownload_notDownloaded": "Не завантажено",
"modelDownload_downloading": "Завантаження",
"modelDownload_active": "Активна",
"modelDownload_failed": "Не вдалося завантажити",
"modelDownload_incomplete": "Неповна",
"modelDownload_verifying": "Перевірка завантаження",
"modelDownload_useModel": "Використовувати цю модель",
"modelDownload_removeFailed": "Не вдалося видалити модель: {error}",
"modelDownload_progress": "{current} / {total} MB ({percent}%)"
}
+11 -2
View File
@@ -3813,7 +3813,7 @@
"backupRestore_backupComplete": "备份文件已创建。",
"backupRestore_restoreComplete": "恢复完成。如果恢复了无线电身份,请重新连接。",
"backupRestore_missingModelsTitle": "模型未下载",
"backupRestore_missingModelsMessage": "恢复的设置所选用的模型在此设备上不可用:\n{models}\n\n现在下载吗?",
"backupRestore_missingModelsMessage": "恢复的设置所选用的模型在此设备上不可用。现在下载吗?",
"backupRestore_downloadModels": "下载模型",
"backupRestore_downloading": "正在下载…",
"backupRestore_cancelDownload": "取消下载",
@@ -3833,5 +3833,14 @@
"connectSheet_chooseRadioSubtitle": "蓝牙、USB 或 TCP",
"connectSheet_stopReconnecting": "停止重新连接",
"connectSheet_reconnectFailed": "无法连接到 {name}。请确保其已开机且在附近。",
"chat_composerOffline": "连接到无线电后才能发送消息"
"chat_composerOffline": "连接到无线电后才能发送消息",
"modelDownload_notDownloaded": "未下载",
"modelDownload_downloading": "正在下载",
"modelDownload_active": "当前使用",
"modelDownload_failed": "下载失败",
"modelDownload_incomplete": "不完整",
"modelDownload_verifying": "正在校验下载",
"modelDownload_useModel": "使用此模型",
"modelDownload_removeFailed": "无法移除模型:{error}",
"modelDownload_progress": "{current} / {total} MB ({percent}%)"
}
+5 -163
View File
@@ -5,15 +5,14 @@ import 'package:provider/provider.dart';
import '../connector/meshcore_connector.dart';
import '../l10n/l10n.dart';
import '../models/app_settings.dart';
import '../models/image_codec_support.dart';
import '../services/app_settings_service.dart';
import '../services/background_service.dart';
import '../services/image_codec_service.dart';
import '../services/map_tile_cache_service.dart';
import '../services/notification_service.dart';
import '../theme/mesh_theme.dart';
import '../utils/platform_info.dart';
import '../widgets/adaptive_app_bar_title.dart';
import '../widgets/image_codec_models_section.dart';
import '../widgets/cyr2lat_profile_dialog.dart';
import '../widgets/language_picker_sheet.dart';
import '../widgets/mesh_nav_tile.dart';
@@ -739,7 +738,10 @@ class AppSettingsScreen extends StatelessWidget {
onChanged: (value) =>
settingsService.setImageProcessAutomatically(value),
),
_buildImageCodecModels(context),
if (_imageCodecService(context) != null) ...[
const Divider(height: 1, indent: 16),
const ImageCodecModelsSection(),
],
],
],
);
@@ -764,166 +766,6 @@ class AppSettingsScreen extends StatelessWidget {
);
}
/// Model registry for image messages: the download entry point, the
/// downloaded weights, and — when the build simply cannot run the codec —
/// [ImageCodecService.unavailableReason] instead of a dead download button.
Widget _buildImageCodecModels(BuildContext context) {
final ImageCodecService codec;
try {
codec = context.watch<ImageCodecService>();
} on ProviderNotFoundException {
return const SizedBox.shrink();
}
final scheme = Theme.of(context).colorScheme;
final textTheme = Theme.of(context).textTheme;
final reason = codec.unavailableReason;
return Padding(
padding: const EdgeInsets.fromLTRB(16, 4, 16, 16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
context.l10n.imageMessages_modelSectionTitle,
style: textTheme.titleSmall,
),
const SizedBox(height: 6),
if (reason != null)
Container(
padding: const EdgeInsets.all(12),
decoration: BoxDecoration(
color: scheme.surfaceContainerHighest,
borderRadius: BorderRadius.circular(MeshRadii.md),
),
child: Text(
reason,
style: textTheme.bodyMedium?.copyWith(
color: scheme.onSurfaceVariant,
),
),
),
for (final spec in imageCodecPresetModels)
_buildImageCodecPreset(context, codec, spec),
for (final model in codec.availableModels)
ListTile(
contentPadding: EdgeInsets.zero,
dense: true,
leading: const Icon(Icons.check_circle_outline, size: 24),
title: Text(model.name.isEmpty ? model.id : model.name),
subtitle: Text(_formatModelBytes(context, model.fileSizeBytes)),
trailing: IconButton(
icon: const Icon(Icons.delete_outline, size: 24),
tooltip: context.l10n.imageMessages_removeModel,
onPressed: codec.isBusy || codec.isDownloading
? null
: () => codec.removeModel(model),
),
),
if (codec.lastError != null) ...[
const SizedBox(height: 6),
Text(
codec.lastError!,
style: textTheme.bodyMedium?.copyWith(color: scheme.error),
),
],
],
),
);
}
Widget _buildImageCodecPreset(
BuildContext context,
ImageCodecService codec,
ImageCodecModelSpec spec,
) {
final textTheme = Theme.of(context).textTheme;
final scheme = Theme.of(context).colorScheme;
final alreadyHave = spec.hasCompleteInstalledRecord(codec.availableModels);
// downloadPresetModel throws StateError on a placeholder URL, deliberately,
// so the button must not be offerable until the weights are published.
final blocked = spec.urlsArePlaceholders;
final busy = codec.isDownloading;
return Padding(
padding: const EdgeInsets.only(top: 4),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
ListTile(
contentPadding: EdgeInsets.zero,
dense: true,
leading: const Icon(Icons.download_outlined, size: 24),
title: Text(spec.label),
subtitle: Text(
blocked
? context.l10n.imageMessages_modelNotPublished
: _formatModelBytes(context, spec.totalSizeBytes),
),
trailing: alreadyHave
? Text(
context.l10n.imageMessages_modelReady,
style: textTheme.labelMedium?.copyWith(
color: scheme.onSurfaceVariant,
),
)
: busy
? TextButton(
onPressed: codec.cancelDownload,
child: Text(context.l10n.imageMessages_cancelDownload),
)
: TextButton(
onPressed: blocked
? null
: () => _downloadImageCodecModel(context, codec, spec),
child: Text(context.l10n.imageMessages_downloadModel),
),
),
if (busy)
Padding(
padding: const EdgeInsets.only(bottom: 8),
child: LinearProgressIndicator(value: codec.downloadProgress),
),
],
),
);
}
Future<void> _downloadImageCodecModel(
BuildContext context,
ImageCodecService codec,
ImageCodecModelSpec spec,
) async {
final messenger = ScaffoldMessenger.of(context);
final l10n = context.l10n;
try {
await codec.downloadPresetModel(spec);
} catch (error) {
messenger.showSnackBar(
SnackBar(
content: Text(l10n.imageMessages_downloadFailedWithError('$error')),
),
);
}
}
String _formatModelBytes(BuildContext context, int bytes) {
final l10n = context.l10n;
if (bytes >= 1024 * 1024 * 1024) {
return l10n.mapCache_sizeGigabytes(
(bytes / (1024 * 1024 * 1024)).toStringAsFixed(2),
);
}
if (bytes >= 1024 * 1024) {
return l10n.mapCache_sizeMegabytes(
(bytes / (1024 * 1024)).toStringAsFixed(0),
);
}
if (bytes >= 1024) {
return l10n.mapCache_sizeKilobytes((bytes / 1024).toStringAsFixed(0));
}
return l10n.mapCache_sizeBytes('$bytes');
}
Widget _buildBatteryContent(
BuildContext context,
AppSettingsService settingsService,
+105 -38
View File
@@ -22,6 +22,7 @@ import '../utils/platform_info.dart';
import '../utils/share_origin.dart';
import '../widgets/app_bar.dart';
import '../widgets/mesh_ui.dart';
import '../widgets/model_download_list.dart';
import '../widgets/sync_progress_overlay.dart';
class BackupRestoreScreen extends StatefulWidget {
@@ -630,12 +631,6 @@ class _BackupRestoreScreenState extends State<BackupRestoreScreen> {
required ImageCodecService imageCodecService,
}) async {
final l10n = context.l10n;
final modelNames = [
if (translationModel != null)
translationModelFriendlyName(translationModel),
if (imageCodecModel != null)
imageCodecSpec?.label ?? imageCodecModel.name,
];
var starting = false;
var cancelRequested = false;
var translationDone = translationModel == null;
@@ -658,16 +653,9 @@ class _BackupRestoreScreenState extends State<BackupRestoreScreen> {
starting ||
translationService.isDownloading ||
imageCodecService.isDownloading;
final currentProgress = currentModel == translationModel?.name
? translationService.downloadProgress
: currentModel == imageCodecModel?.name
? imageCodecService.downloadProgress
: null;
final currentFile = currentModel == translationModel?.name
? translationService.downloadFileName
: currentModel == imageCodecModel?.name
? imageCodecService.downloadFileName
: null;
final translationCurrent = currentModel == translationModel?.name;
final imageCurrent = currentModel == imageCodecModel?.name;
final failure = downloadError;
void requestDownloadCancel() {
cancelRequested = true;
@@ -682,31 +670,73 @@ class _BackupRestoreScreenState extends State<BackupRestoreScreen> {
},
child: AlertDialog(
title: Text(l10n.backupRestore_missingModelsTitle),
content: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
l10n.backupRestore_missingModelsMessage(
modelNames.join('\n'),
),
),
if (isDownloading) ...[
const SizedBox(height: 16),
Text(currentFile ?? currentModel ?? ''),
const SizedBox(height: 8),
LinearProgressIndicator(value: currentProgress),
],
if (downloadError != null) ...[
content: SingleChildScrollView(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(l10n.backupRestore_missingModelsMessage),
const SizedBox(height: 12),
Text(
l10n.backupRestore_failed(downloadError!),
style: TextStyle(
color: Theme.of(context).colorScheme.error,
),
ModelDownloadList(
rowPadding: const EdgeInsets.symmetric(vertical: 4),
items: [
if (translationModel != null)
_missingModelItem(
id: 'translation-${translationModel.id}',
name: translationModelFriendlyName(
translationModel,
),
sizeBytes: translationModel.fileSizeBytes,
done: translationDone,
current: translationCurrent,
downloading:
translationService.isDownloading ||
(starting && translationCurrent),
progress: translationService.downloadProgress,
downloadedBytes:
translationService.downloadedBytes,
totalBytes: translationService.downloadTotalBytes,
detail:
translationService.downloadFileName ==
'Merging chunks...'
? l10n.translation_mergingChunks
: null,
error: failure == null
? null
: l10n.backupRestore_failed(failure),
),
if (imageCodecModel != null)
_missingModelItem(
id: 'image-${imageCodecModel.id}',
name:
imageCodecSpec?.label ??
imageCodecModelFriendlyName(imageCodecModel),
sizeBytes:
imageCodecSpec?.totalSizeBytes ??
imageCodecModel.fileSizeBytes,
done: imageCodecDone,
current: imageCurrent,
downloading:
imageCodecService.isDownloading ||
(starting && imageCurrent),
progress: imageCodecService.downloadProgress,
downloadedBytes:
imageCodecService.downloadedBytes,
totalBytes: imageCodecService.downloadTotalBytes,
detail:
imageCodecService.downloadFileName
?.startsWith('Verifying ') ==
true
? l10n.modelDownload_verifying
: null,
error: failure == null
? null
: l10n.backupRestore_failed(failure),
),
],
),
],
],
),
),
actions: [
TextButton(
@@ -830,3 +860,40 @@ class _BackupRestoreScreenState extends State<BackupRestoreScreen> {
showDismissibleSnackBar(context, content: Text(message));
}
}
ModelDownloadItem _missingModelItem({
required String id,
required String name,
required int sizeBytes,
required bool done,
required bool current,
required bool downloading,
required double? progress,
required int downloadedBytes,
required int? totalBytes,
required String? detail,
required String? error,
}) {
final inProgress = downloading && current && !done;
final failed = error != null && current && !inProgress && !done;
return ModelDownloadItem(
id: id,
name: name,
sizeBytes: sizeBytes > 0 ? sizeBytes : null,
status: done
? ModelDownloadStatus.ready
: failed
? ModelDownloadStatus.error
: inProgress
? ModelDownloadStatus.downloading
: ModelDownloadStatus.notDownloaded,
progress: inProgress ? progress : null,
downloadedBytes: inProgress ? downloadedBytes : 0,
totalBytes: inProgress ? totalBytes : null,
detail: failed
? error
: inProgress
? detail
: null,
);
}
+297
View File
@@ -0,0 +1,297 @@
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../helpers/snack_bar_builder.dart';
import '../l10n/l10n.dart';
import '../models/image_codec_support.dart';
import '../services/image_codec_service.dart';
import '../theme/mesh_theme.dart';
import 'model_download_list.dart';
/// Image-codec registry: one [ModelDownloadList] row per model.
///
/// A preset and the files it installed are the same row. The friendly name is
/// the preset label, never the on-disk graph filename.
class ImageCodecModelsSection extends StatefulWidget {
const ImageCodecModelsSection({super.key});
@override
State<ImageCodecModelsSection> createState() =>
_ImageCodecModelsSectionState();
}
class _ImageCodecModelsSectionState extends State<ImageCodecModelsSection> {
String? _failedId;
String? _failedDetail;
@override
Widget build(BuildContext context) {
final codec = context.watch<ImageCodecService>();
final l10n = context.l10n;
final theme = Theme.of(context);
final scheme = theme.colorScheme;
final reason = codec.unavailableReason;
final lastError = codec.lastError;
final showLastError =
lastError != null &&
lastError.isNotEmpty &&
lastError != 'Download stopped.' &&
lastError != _failedDetail;
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.fromLTRB(16, 12, 16, 4),
child: Text(
l10n.imageMessages_modelSectionTitle,
style: theme.textTheme.titleSmall,
),
),
if (reason != null)
Padding(
padding: const EdgeInsets.fromLTRB(16, 4, 16, 8),
child: DecoratedBox(
decoration: BoxDecoration(
color: scheme.surfaceContainerHighest,
borderRadius: BorderRadius.circular(MeshRadii.md),
),
child: Padding(
padding: const EdgeInsets.all(12),
child: Text(
reason,
style: theme.textTheme.bodyMedium?.copyWith(
color: scheme.onSurfaceVariant,
),
),
),
),
),
ModelDownloadList(items: _items(context, codec)),
if (showLastError)
Padding(
padding: const EdgeInsets.fromLTRB(16, 4, 16, 12),
child: Text(
lastError,
style: theme.textTheme.bodyMedium?.copyWith(color: scheme.error),
),
)
else
const SizedBox(height: 8),
],
);
}
List<ModelDownloadItem> _items(
BuildContext context,
ImageCodecService codec,
) {
final models = codec.availableModels;
final used = <ImageCodecModelRecord>{};
final items = <ModelDownloadItem>[];
for (final spec in imageCodecPresetModels) {
final belonging = [
for (final model in models)
if (_belongsToSpec(model, spec)) model,
];
used.addAll(belonging);
final record = _preferredRecord(belonging, spec);
items.add(_presetItem(context, codec, spec, record));
}
for (final model in models) {
if (used.contains(model)) continue;
items.add(_customItem(context, codec, model));
}
return items;
}
ModelDownloadItem _presetItem(
BuildContext context,
ImageCodecService codec,
ImageCodecModelSpec spec,
ImageCodecModelRecord? record,
) {
final l10n = context.l10n;
final blocked = spec.urlsArePlaceholders;
final installedId = record?.id;
final complete =
record != null && spec.hasCompleteInstalledRecord([record]);
final downloading = !blocked && _specIsDownloading(codec, spec);
final verifying = downloading && _isVerifying(codec);
final failed = !downloading && !complete && _failedId == spec.id;
final selectedId = codec.selectedModel?.id;
final selected =
complete && (selectedId == spec.id || selectedId == installedId);
final busy = codec.isBusy || codec.isDownloading;
final ModelDownloadStatus status;
String? statusLabel;
if (downloading) {
status = ModelDownloadStatus.downloading;
} else if (complete) {
status = ModelDownloadStatus.ready;
} else if (failed) {
status = ModelDownloadStatus.error;
} else {
status = ModelDownloadStatus.notDownloaded;
if (record != null && !blocked) {
statusLabel = l10n.modelDownload_incomplete;
}
}
final size = record != null && record.fileSizeBytes > 0
? record.fileSizeBytes
: spec.totalSizeBytes;
return ModelDownloadItem(
id: spec.id,
name: spec.label,
sizeBytes: size > 0 ? size : null,
status: status,
statusLabel: statusLabel,
selected: selected,
enabled: !blocked,
progress: verifying ? null : codec.downloadProgress,
downloadedBytes: downloading ? codec.downloadedBytes : 0,
totalBytes: downloading ? codec.downloadTotalBytes : null,
detail: blocked
? l10n.imageMessages_modelNotPublished
: verifying
? l10n.modelDownload_verifying
: failed
? _failedDetail
: null,
onDownload: !blocked && !complete && !codec.isDownloading
? () => _download(spec)
: null,
onCancel: downloading ? codec.cancelDownload : null,
onDelete: record != null && !busy ? () => _delete(record) : null,
onSelect: complete && !selected && !busy
? () => codec.setSelectedModelId(installedId ?? spec.id)
: null,
);
}
ModelDownloadItem _customItem(
BuildContext context,
ImageCodecService codec,
ImageCodecModelRecord model,
) {
final l10n = context.l10n;
final downloading = _recordIsDownloading(codec, model);
final verifying = downloading && _isVerifying(codec);
final ready = model.localPath.isNotEmpty && !downloading;
final busy = codec.isBusy || codec.isDownloading;
final selected = ready && codec.selectedModel?.id == model.id;
return ModelDownloadItem(
id: model.id,
name: imageCodecModelFriendlyName(model),
sizeBytes: model.fileSizeBytes > 0 ? model.fileSizeBytes : null,
status: downloading
? ModelDownloadStatus.downloading
: ready
? ModelDownloadStatus.ready
: ModelDownloadStatus.notDownloaded,
selected: selected,
progress: verifying ? null : codec.downloadProgress,
downloadedBytes: downloading ? codec.downloadedBytes : 0,
totalBytes: downloading ? codec.downloadTotalBytes : null,
detail: verifying ? l10n.modelDownload_verifying : null,
onCancel: downloading ? codec.cancelDownload : null,
onDelete: !busy ? () => _delete(model) : null,
onSelect: ready && !selected && !busy
? () => codec.setSelectedModelId(model.id)
: null,
);
}
bool _specIsDownloading(ImageCodecService codec, ImageCodecModelSpec spec) {
if (!codec.isDownloading) return false;
final name = _downloadFileName(codec);
if (name == null) return imageCodecPresetModels.length == 1;
return spec.assets.any((asset) => asset.fileName == name);
}
bool _recordIsDownloading(
ImageCodecService codec,
ImageCodecModelRecord model,
) {
if (!codec.isDownloading) return false;
final name = _downloadFileName(codec);
if (name == null) return false;
return model.name == name || model.assetFileNames.contains(name);
}
bool _isVerifying(ImageCodecService codec) =>
codec.downloadFileName?.startsWith('Verifying ') ?? false;
String? _downloadFileName(ImageCodecService codec) {
final raw = codec.downloadFileName;
if (raw == null || raw.isEmpty) return null;
const prefix = 'Verifying ';
return raw.startsWith(prefix) ? raw.substring(prefix.length) : raw;
}
Future<void> _download(ImageCodecModelSpec spec) async {
setState(() {
_failedId = null;
_failedDetail = null;
});
final l10n = context.l10n;
try {
await context.read<ImageCodecService>().downloadPresetModel(spec);
} on ImageCodecDownloadCancelled {
if (!mounted) return;
showDismissibleSnackBar(
context,
content: Text(l10n.translation_downloadStopped),
);
} catch (error) {
if (!mounted) return;
final message = l10n.imageMessages_downloadFailedWithError('$error');
setState(() {
_failedId = spec.id;
_failedDetail = message;
});
showDismissibleSnackBar(context, content: Text(message));
}
}
Future<void> _delete(ImageCodecModelRecord model) async {
final l10n = context.l10n;
try {
await context.read<ImageCodecService>().removeModel(model);
} catch (error) {
if (!mounted) return;
showDismissibleSnackBar(
context,
content: Text(l10n.modelDownload_removeFailed('$error')),
);
}
}
}
bool _belongsToSpec(ImageCodecModelRecord model, ImageCodecModelSpec spec) {
if (model.id == spec.id || model.name == spec.fileName) return true;
for (final asset in spec.assets) {
if (asset.fileName == model.name) return true;
}
return false;
}
ImageCodecModelRecord? _preferredRecord(
List<ImageCodecModelRecord> models,
ImageCodecModelSpec spec,
) {
for (final model in models) {
if (spec.hasCompleteInstalledRecord([model])) return model;
}
for (final model in models) {
if (model.id == spec.id) return model;
}
if (models.isEmpty) return null;
return models.first;
}
+338
View File
@@ -0,0 +1,338 @@
import 'package:flutter/material.dart';
import '../l10n/app_localizations.dart';
import '../l10n/l10n.dart';
import '../theme/mesh_theme.dart';
import 'mesh_nav_tile.dart';
/// Install state of one on-device model row.
enum ModelDownloadStatus { notDownloaded, downloading, ready, error }
/// One model in a [ModelDownloadList].
///
/// Callers own the download. This only describes what the row should show
/// and which action to offer.
class ModelDownloadItem {
final String id;
final String name;
/// Bytes on disk, or the expected download size before anything is fetched.
/// Zero and null both mean "size unknown" and are omitted.
final int? sizeBytes;
final ModelDownloadStatus status;
/// True when this installed model is the one the feature will use.
final bool selected;
/// False dims the row and drops its actions, same as a disabled settings tile.
final bool enabled;
/// 0–1 while [status] is [ModelDownloadStatus.downloading]. Null is an
/// indeterminate bar (size unknown, merging, or verifying).
final double? progress;
final int downloadedBytes;
final int? totalBytes;
/// Extra line under the status: a failure, a "not published" note, or
/// "merging" / "verifying" while a download finishes.
final String? detail;
/// Replaces the default status word. Used for an install that started but
/// did not finish ("Incomplete").
final String? statusLabel;
final VoidCallback? onDownload;
final VoidCallback? onCancel;
final VoidCallback? onDelete;
final VoidCallback? onSelect;
const ModelDownloadItem({
required this.id,
required this.name,
required this.status,
this.sizeBytes,
this.selected = false,
this.enabled = true,
this.progress,
this.downloadedBytes = 0,
this.totalBytes,
this.detail,
this.statusLabel,
this.onDownload,
this.onCancel,
this.onDelete,
this.onSelect,
});
bool get isActive => selected && status == ModelDownloadStatus.ready;
}
/// Shared list of on-device models: name, size, status, selection, and one
/// action (download, cancel, or remove).
///
/// Sits inside an existing card. It does not scroll; the page or dialog does.
class ModelDownloadList extends StatelessWidget {
final List<ModelDownloadItem> items;
/// When null, a row with an action keeps the button's own padding on the
/// right, and a row without one uses 16.
final EdgeInsets? rowPadding;
const ModelDownloadList({super.key, required this.items, this.rowPadding});
@override
Widget build(BuildContext context) {
return Column(
children: [
for (var i = 0; i < items.length; i++) ...[
if (i > 0) const Divider(height: 1, indent: 16),
_ModelDownloadRow(item: items[i], padding: rowPadding),
],
],
);
}
}
class _ModelDownloadRow extends StatelessWidget {
final ModelDownloadItem item;
final EdgeInsets? padding;
const _ModelDownloadRow({required this.item, required this.padding});
@override
Widget build(BuildContext context) {
final l10n = context.l10n;
final theme = Theme.of(context);
final scheme = theme.colorScheme;
final onTap = _rowTap();
final actions = _actions(l10n);
final statusWord = _statusWord(l10n);
final sizeLabel = _sizeLabel(l10n);
final caption = _progressCaption(l10n);
final row = Padding(
padding:
padding ??
(actions.isEmpty
? const EdgeInsets.fromLTRB(16, 8, 16, 8)
: const EdgeInsets.fromLTRB(16, 8, 0, 8)),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(top: 2),
child: _leading(scheme),
),
const SizedBox(width: 16),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(item.name, style: meshTileTitleStyle(theme)),
const SizedBox(height: 2),
Text.rich(
TextSpan(
style: theme.textTheme.bodyMedium?.copyWith(
color: scheme.onSurfaceVariant,
),
children: [
if (sizeLabel != null) ...[
TextSpan(
text: sizeLabel,
style: MeshTheme.mono(
fontSize: 14,
color: scheme.onSurfaceVariant,
),
),
const TextSpan(text: ' · '),
],
TextSpan(text: statusWord),
if (item.isActive) ...[
const TextSpan(text: ' · '),
TextSpan(
text: l10n.modelDownload_active,
style: theme.textTheme.bodyMedium?.copyWith(
color: scheme.onSurface,
fontWeight: FontWeight.w600,
),
),
],
],
),
),
if (item.detail != null && item.detail!.isNotEmpty) ...[
const SizedBox(height: 2),
Text(
item.detail!,
style: theme.textTheme.bodyMedium?.copyWith(
color: item.status == ModelDownloadStatus.error
? scheme.error
: scheme.onSurfaceVariant,
),
),
],
if (item.status == ModelDownloadStatus.downloading) ...[
const SizedBox(height: 8),
LinearProgressIndicator(value: item.progress),
if (caption != null) ...[
const SizedBox(height: 4),
Text(
caption,
style: MeshTheme.mono(
fontSize: 12,
color: scheme.onSurfaceVariant,
),
),
],
],
],
),
),
if (actions.isNotEmpty)
Row(mainAxisSize: MainAxisSize.min, children: actions),
],
),
);
return Opacity(
opacity: item.enabled ? 1 : 0.5,
child: Semantics(
button: onTap != null,
enabled: item.enabled,
selected: item.isActive,
hint: item.status == ModelDownloadStatus.ready && item.onSelect != null
? l10n.modelDownload_useModel
: null,
child: IgnorePointer(
ignoring: !item.enabled,
child: InkWell(
key: ValueKey('model-row-${item.id}'),
onTap: onTap,
child: row,
),
),
),
);
}
VoidCallback? _rowTap() {
if (!item.enabled) return null;
if (item.status == ModelDownloadStatus.ready) return item.onSelect;
if (item.status == ModelDownloadStatus.downloading) return null;
return item.onDownload;
}
Widget _leading(ColorScheme scheme) {
switch (item.status) {
case ModelDownloadStatus.downloading:
return const SizedBox(
width: 24,
height: 24,
child: CircularProgressIndicator(strokeWidth: 2),
);
case ModelDownloadStatus.error:
return Icon(Icons.error_outline, size: 24, color: scheme.error);
case ModelDownloadStatus.ready:
return Icon(
item.isActive ? Icons.check_circle : Icons.check_circle_outline,
size: 24,
color: item.isActive ? scheme.primary : scheme.onSurfaceVariant,
);
case ModelDownloadStatus.notDownloaded:
return Icon(
Icons.download_outlined,
size: 24,
color: scheme.onSurfaceVariant,
);
}
}
List<Widget> _actions(AppLocalizations l10n) {
if (!item.enabled) return const [];
if (item.status == ModelDownloadStatus.downloading) {
if (item.onCancel == null) return const [];
return [
IconButton(
key: ValueKey('model-cancel-${item.id}'),
tooltip: l10n.imageMessages_cancelDownload,
onPressed: item.onCancel,
icon: const Icon(Icons.close),
),
];
}
final actions = <Widget>[];
if (item.status != ModelDownloadStatus.ready && item.onDownload != null) {
actions.add(
IconButton(
key: ValueKey('model-download-${item.id}'),
tooltip: l10n.imageMessages_downloadModel,
onPressed: item.onDownload,
icon: const Icon(Icons.download_outlined),
),
);
}
if (item.onDelete != null) {
actions.add(
IconButton(
key: ValueKey('model-remove-${item.id}'),
tooltip: l10n.imageMessages_removeModel,
onPressed: item.onDelete,
icon: const Icon(Icons.delete_outline),
),
);
}
return actions;
}
String _statusWord(AppLocalizations l10n) {
final override = item.statusLabel;
if (override != null && override.isNotEmpty) return override;
switch (item.status) {
case ModelDownloadStatus.notDownloaded:
return l10n.modelDownload_notDownloaded;
case ModelDownloadStatus.downloading:
return l10n.modelDownload_downloading;
case ModelDownloadStatus.ready:
return l10n.imageMessages_modelReady;
case ModelDownloadStatus.error:
return l10n.modelDownload_failed;
}
}
String? _sizeLabel(AppLocalizations l10n) {
final bytes = item.sizeBytes;
if (bytes == null || bytes <= 0) return null;
if (bytes >= 1024 * 1024 * 1024) {
return l10n.mapCache_sizeGigabytes(
(bytes / (1024 * 1024 * 1024)).toStringAsFixed(2),
);
}
if (bytes >= 1024 * 1024) {
final mb = bytes / (1024 * 1024);
final digits = mb >= 100 ? 0 : 1;
return l10n.mapCache_sizeMegabytes(mb.toStringAsFixed(digits));
}
if (bytes >= 1024) {
return l10n.mapCache_sizeKilobytes((bytes / 1024).toStringAsFixed(0));
}
return l10n.mapCache_sizeBytes('$bytes');
}
String? _progressCaption(AppLocalizations l10n) {
if (item.status != ModelDownloadStatus.downloading) return null;
if (item.detail != null && item.detail!.isNotEmpty) return null;
final currentMb = item.downloadedBytes / (1024 * 1024);
final total = item.totalBytes;
if (total == null || total <= 0) {
return l10n.mapCache_sizeMegabytes(currentMb.toStringAsFixed(1));
}
final totalMb = total / (1024 * 1024);
final fraction = item.progress ?? (item.downloadedBytes / total);
final percent = (fraction * 100).clamp(0, 100).toStringAsFixed(0);
return l10n.modelDownload_progress(
currentMb.toStringAsFixed(1),
totalMb.toStringAsFixed(1),
percent,
);
}
}
+366 -322
View File
@@ -2,12 +2,14 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../helpers/snack_bar_builder.dart';
import '../l10n/app_localizations.dart';
import '../l10n/l10n.dart';
import '../models/app_settings.dart';
import '../models/translation_support.dart';
import '../services/app_settings_service.dart';
import '../services/translation_service.dart';
import '../theme/mesh_theme.dart';
import 'mesh_nav_tile.dart';
import 'model_download_list.dart';
/// [TranslationService] publishes this as `downloadFileName` while it merges
/// downloaded chunks (see translation_service.dart). The service owns the
@@ -15,24 +17,21 @@ import 'mesh_nav_tile.dart';
/// place, until the service grows a proper "merging" getter.
const String _mergingChunksFileName = 'Merging chunks...';
/// On-device translation settings: feature toggles, target language, model
/// selection, model downloads and the downloaded-model list.
/// On-device translation settings: feature toggles, target language, and the
/// shared model list.
///
/// Watches only [AppSettingsService] and [TranslationService], so download
/// progress ticks rebuild this card and nothing else on the settings screen.
/// [_TranslationModels] watches [TranslationService], so download progress
/// rebuilds the model rows and not the toggles above them.
class TranslationSettingsSection extends StatelessWidget {
const TranslationSettingsSection({super.key});
@override
Widget build(BuildContext context) {
final settingsService = context.watch<AppSettingsService>();
final translationService = context.watch<TranslationService>();
final l10n = context.l10n;
final settings = settingsService.settings;
final translationEnabled = settings.translationEnabled;
final theme = Theme.of(context);
final scheme = theme.colorScheme;
final textTheme = theme.textTheme;
final disabledColor = translationEnabled ? null : theme.disabledColor;
const tilePadding = EdgeInsets.symmetric(horizontal: 16, vertical: 4);
@@ -96,201 +95,11 @@ class TranslationSettingsSection extends StatelessWidget {
onTap: () => _showTranslationLanguageDialog(context, settingsService),
),
const Divider(height: 1, indent: 16),
Padding(
padding: const EdgeInsets.fromLTRB(16, 12, 16, 4),
child: DropdownButtonFormField<String>(
initialValue: settings.translationSelectedModelId,
isExpanded: true,
decoration: InputDecoration(
labelText: l10n.translation_downloadedModelLabel,
border: const OutlineInputBorder(),
),
items: [
for (final model in settings.translationDownloadedModels)
DropdownMenuItem(
value: model.id,
child: Text(
translationModelFriendlyName(model),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
),
],
onChanged: settings.translationDownloadedModels.isEmpty
? null
: (value) {
settingsService.setTranslationSelectedModelId(value);
},
),
),
Padding(
padding: const EdgeInsets.fromLTRB(16, 12, 16, 4),
child: DropdownButtonFormField<String>(
initialValue: null,
isExpanded: true,
decoration: InputDecoration(
labelText: l10n.translation_presetModelLabel,
border: const OutlineInputBorder(),
),
items: [
for (final preset in translationPresetModels)
DropdownMenuItem(
value: preset.sourceUrl,
child: Text(
translationModelFriendlyName(preset),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
),
],
onChanged: translationService.isBusy
? null
: (value) async {
if (value == null) return;
final preset = translationPresetModels.firstWhere(
(entry) => entry.sourceUrl == value,
);
await _downloadTranslationModel(
context,
translationService,
settingsService,
sourceUrl: preset.sourceUrl,
fileName: preset.name,
id: preset.id,
);
},
),
),
Padding(
padding: const EdgeInsets.fromLTRB(16, 12, 16, 16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
_TranslationUrlField(
initialValue: settings.translationModelSourceUrl ?? '',
onChanged: settingsService.setTranslationModelSourceUrl,
onDownload: translationService.isBusy
? null
: (url) => _downloadTranslationModel(
context,
translationService,
settingsService,
sourceUrl: url,
),
downloadLabel: translationService.isDownloading
? l10n.translation_downloading
: translationService.isBusy
? l10n.translation_working
: l10n.translation_downloadModel,
isDownloading: translationService.isDownloading,
onCancel: translationService.cancelDownload,
labelText: l10n.translation_manualUrlLabel,
stopLabel: l10n.translation_stop,
),
if (translationService.isDownloading) ...[
const SizedBox(height: 12),
ClipRRect(
borderRadius: BorderRadius.circular(2),
child: LinearProgressIndicator(
value: _isMerging(translationService)
? null
: translationService.downloadProgress,
),
),
const SizedBox(height: 8),
Align(
alignment: Alignment.centerLeft,
child: Text(
_downloadProgressLabel(context, translationService),
style: MeshTheme.mono(
fontSize: 14,
color: scheme.onSurfaceVariant,
),
),
),
],
if (settings.translationDownloadedModels.isNotEmpty) ...[
const SizedBox(height: 16),
Align(
alignment: Alignment.centerLeft,
child: Text(
l10n.translation_downloadedModels,
style: textTheme.titleSmall,
),
),
const SizedBox(height: 8),
for (final model in settings.translationDownloadedModels)
Padding(
padding: const EdgeInsets.only(bottom: 8),
child: Row(
children: [
Icon(
model.id == settings.translationSelectedModelId
? Icons.check_circle
: Icons.memory_outlined,
size: 24,
color: model.id == settings.translationSelectedModelId
? scheme.primary
: scheme.onSurfaceVariant,
),
const SizedBox(width: 12),
Expanded(
child: InkWell(
borderRadius: BorderRadius.circular(MeshRadii.xs),
onTap: () => settingsService
.setTranslationSelectedModelId(model.id),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
translationModelFriendlyName(model),
style: textTheme.bodyLarge?.copyWith(
fontWeight: FontWeight.w600,
),
),
Text(
_downloadedModelLabel(context, model),
style: MeshTheme.mono(
fontSize: 12,
color: scheme.onSurfaceVariant,
),
),
],
),
),
),
IconButton(
tooltip: l10n.translation_deleteModel,
onPressed: translationService.isBusy
? null
: () => _deleteTranslationModel(
context,
translationService,
model,
),
icon: const Icon(Icons.delete_outline),
),
],
),
),
],
if (translationService.lastError != null) ...[
const SizedBox(height: 8),
Text(
translationService.lastError!,
style: TextStyle(color: scheme.error),
),
],
],
),
),
const _TranslationModels(),
],
);
}
static bool _isMerging(TranslationService service) =>
service.downloadFileName == _mergingChunksFileName;
void _showTranslationLanguageDialog(
BuildContext context,
AppSettingsService settingsService,
@@ -308,50 +117,6 @@ class TranslationSettingsSection extends StatelessWidget {
);
}
Future<void> _downloadTranslationModel(
BuildContext context,
TranslationService translationService,
AppSettingsService settingsService, {
required String sourceUrl,
String? fileName,
String? id,
}) async {
if (sourceUrl.isEmpty) {
showDismissibleSnackBar(
context,
content: Text(context.l10n.translation_enterUrlFirst),
);
return;
}
try {
await translationService.downloadModel(
sourceUrl: sourceUrl,
fileName: fileName,
id: id,
);
if (!context.mounted) return;
showDismissibleSnackBar(
context,
content: Text(context.l10n.translation_modelDownloaded),
);
await settingsService.setTranslationEnabled(true);
} on TranslationDownloadCancelled {
if (!context.mounted) return;
showDismissibleSnackBar(
context,
content: Text(context.l10n.translation_downloadStopped),
);
} catch (error) {
if (!context.mounted) return;
showDismissibleSnackBar(
context,
content: Text(
context.l10n.translation_downloadFailed(error.toString()),
),
);
}
}
String _translationLanguageLabel(BuildContext context, String? languageCode) {
if (languageCode == null || languageCode.isEmpty) {
return context.l10n.translation_useAppLanguage;
@@ -363,45 +128,324 @@ class TranslationSettingsSection extends StatelessWidget {
}
return languageCode.toUpperCase();
}
}
String _downloadProgressLabel(
BuildContext context,
TranslationService translationService,
) {
class _PendingDownload {
final String id;
final String name;
final String sourceUrl;
final String? fileName;
final String? modelId;
const _PendingDownload({
required this.id,
required this.name,
required this.sourceUrl,
this.fileName,
this.modelId,
});
}
/// Preset rows, installed models, and the manual URL field.
class _TranslationModels extends StatefulWidget {
const _TranslationModels();
@override
State<_TranslationModels> createState() => _TranslationModelsState();
}
class _TranslationModelsState extends State<_TranslationModels> {
_PendingDownload? _pending;
String? _failedId;
String? _failedDetail;
@override
Widget build(BuildContext context) {
final settingsService = context.watch<AppSettingsService>();
final translationService = context.watch<TranslationService>();
final l10n = context.l10n;
if (_isMerging(translationService)) {
return l10n.translation_mergingChunks;
}
final fileName =
translationService.downloadFileName ??
l10n.translation_defaultModelName;
final currentMb = translationService.downloadedBytes / (1024 * 1024);
final totalBytes = translationService.downloadTotalBytes;
if (totalBytes == null || totalBytes <= 0) {
return l10n.translation_downloadProgressBytes(
fileName,
currentMb.toStringAsFixed(1),
);
}
final totalMb = totalBytes / (1024 * 1024);
final percent = ((translationService.downloadProgress ?? 0) * 100)
.toStringAsFixed(0);
return l10n.translation_downloadProgressTotal(
fileName,
currentMb.toStringAsFixed(1),
totalMb.toStringAsFixed(1),
percent,
final settings = settingsService.settings;
final scheme = Theme.of(context).colorScheme;
final lastError = translationService.lastError;
final showLastError =
lastError != null &&
lastError.isNotEmpty &&
lastError != 'Download stopped.' &&
lastError != _failedDetail;
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
ModelDownloadList(
items: _items(l10n, settings, settingsService, translationService),
),
const Divider(height: 1, indent: 16),
Padding(
padding: const EdgeInsets.fromLTRB(16, 12, 16, 16),
child: _TranslationUrlField(
initialValue: settings.translationModelSourceUrl ?? '',
onChanged: settingsService.setTranslationModelSourceUrl,
onDownload: translationService.isBusy
? null
: (url) => _download(sourceUrl: url),
labelText: l10n.translation_manualUrlLabel,
downloadTooltip: l10n.imageMessages_downloadModel,
),
),
if (showLastError)
Padding(
padding: const EdgeInsets.fromLTRB(16, 0, 16, 12),
child: Text(
lastError,
style: Theme.of(
context,
).textTheme.bodyMedium?.copyWith(color: scheme.error),
),
),
],
);
}
Future<void> _deleteTranslationModel(
BuildContext context,
List<ModelDownloadItem> _items(
AppLocalizations l10n,
AppSettings settings,
AppSettingsService settingsService,
TranslationService service,
) {
final downloaded = settings.translationDownloadedModels;
final selectedId = settings.translationSelectedModelId;
final pending = _pending;
final used = <TranslationModelRecord>{};
final items = <ModelDownloadItem>[];
var pendingShown = false;
bool targets(String id, String sourceUrl, String name) {
if (pending == null) return false;
if (pending.id == id || pending.modelId == id) return true;
if (sourceUrl.isNotEmpty && pending.sourceUrl == sourceUrl) return true;
if (name.isNotEmpty && pending.name == name) return true;
return false;
}
ModelDownloadItem buildItem({
required String id,
required String name,
required String sourceUrl,
required String? fileName,
required String? modelId,
required TranslationModelRecord? installed,
}) {
if (installed != null) used.add(installed);
final currentFile = service.downloadFileName;
final fileMatches =
currentFile != null &&
currentFile != _mergingChunksFileName &&
(currentFile == fileName || currentFile == installed?.name);
final downloading =
service.isDownloading &&
(targets(id, sourceUrl, name) || fileMatches);
final failed = !downloading && _failedId == id;
if (downloading || failed) pendingShown = true;
final merging = downloading && _isMerging(service);
final busy = service.isBusy;
final installedModel = installed;
return ModelDownloadItem(
id: id,
name: name,
sizeBytes: installedModel != null && installedModel.fileSizeBytes > 0
? installedModel.fileSizeBytes
: null,
status: downloading
? ModelDownloadStatus.downloading
: failed
? ModelDownloadStatus.error
: installedModel != null
? ModelDownloadStatus.ready
: ModelDownloadStatus.notDownloaded,
selected:
installedModel != null &&
!downloading &&
installedModel.id == selectedId,
detail: merging
? l10n.translation_mergingChunks
: failed
? _failedDetail
: null,
progress: downloading && !merging ? service.downloadProgress : null,
downloadedBytes: downloading ? service.downloadedBytes : 0,
totalBytes: downloading ? service.downloadTotalBytes : null,
onDownload: !busy && installedModel == null
? () => _download(
sourceUrl: sourceUrl,
fileName: fileName,
id: modelId,
)
: null,
onCancel: downloading ? service.cancelDownload : null,
onDelete: installedModel != null && !busy
? () => _delete(service, installedModel)
: null,
onSelect:
installedModel != null &&
!downloading &&
installedModel.id != selectedId &&
!busy
? () => settingsService.setTranslationSelectedModelId(
installedModel.id,
)
: null,
);
}
for (final preset in translationPresetModels) {
TranslationModelRecord? installed;
for (final model in downloaded) {
if (model.id == preset.id ||
(preset.sourceUrl.isNotEmpty &&
model.sourceUrl == preset.sourceUrl) ||
(preset.name.isNotEmpty && model.name == preset.name)) {
installed = model;
break;
}
}
items.add(
buildItem(
id: preset.id,
name: translationModelFriendlyName(preset),
sourceUrl: preset.sourceUrl,
fileName: preset.name,
modelId: preset.id,
installed: installed,
),
);
}
for (final model in downloaded) {
if (used.contains(model)) continue;
items.add(
buildItem(
id: model.id,
name: translationModelFriendlyName(model),
sourceUrl: model.sourceUrl,
fileName: model.name,
modelId: model.id,
installed: model,
),
);
}
if (pending != null &&
!pendingShown &&
(service.isDownloading || _failedId == pending.id)) {
final downloading = service.isDownloading;
final merging = downloading && _isMerging(service);
items.add(
ModelDownloadItem(
id: pending.id,
name: pending.name,
status: downloading
? ModelDownloadStatus.downloading
: ModelDownloadStatus.error,
detail: merging
? l10n.translation_mergingChunks
: downloading
? null
: _failedDetail,
progress: downloading && !merging ? service.downloadProgress : null,
downloadedBytes: downloading ? service.downloadedBytes : 0,
totalBytes: downloading ? service.downloadTotalBytes : null,
onCancel: downloading ? service.cancelDownload : null,
onDownload: !service.isBusy && !downloading
? () => _download(
sourceUrl: pending.sourceUrl,
fileName: pending.fileName,
id: pending.modelId,
)
: null,
),
);
}
return items;
}
bool _isMerging(TranslationService service) =>
service.downloadFileName == _mergingChunksFileName;
Future<void> _download({
required String sourceUrl,
String? fileName,
String? id,
}) async {
final trimmed = sourceUrl.trim();
if (trimmed.isEmpty) {
showDismissibleSnackBar(
context,
content: Text(context.l10n.translation_enterUrlFirst),
);
return;
}
final pending = _PendingDownload(
id: id ?? trimmed,
name: _displayName(trimmed, fileName, id),
sourceUrl: trimmed,
fileName: fileName,
modelId: id,
);
setState(() {
_pending = pending;
_failedId = null;
_failedDetail = null;
});
final settingsService = context.read<AppSettingsService>();
final translationService = context.read<TranslationService>();
try {
await translationService.downloadModel(
sourceUrl: trimmed,
fileName: fileName,
id: id,
);
if (!mounted) return;
setState(() {
_pending = null;
_failedId = null;
_failedDetail = null;
});
showDismissibleSnackBar(
context,
content: Text(context.l10n.translation_modelDownloaded),
);
await settingsService.setTranslationEnabled(true);
} on TranslationDownloadCancelled {
if (!mounted) return;
setState(() {
_pending = null;
_failedId = null;
_failedDetail = null;
});
showDismissibleSnackBar(
context,
content: Text(context.l10n.translation_downloadStopped),
);
} catch (error) {
if (!mounted) return;
final message = context.l10n.translation_downloadFailed('$error');
setState(() {
_failedId = pending.id;
_failedDetail = message;
});
showDismissibleSnackBar(context, content: Text(message));
}
}
Future<void> _delete(
TranslationService translationService,
TranslationModelRecord model,
) async {
try {
await translationService.removeModel(model);
if (!context.mounted) return;
if (!mounted) return;
showDismissibleSnackBar(
context,
content: Text(
@@ -411,7 +455,7 @@ class TranslationSettingsSection extends StatelessWidget {
),
);
} catch (error) {
if (!context.mounted) return;
if (!mounted) return;
showDismissibleSnackBar(
context,
content: Text(
@@ -421,17 +465,36 @@ class TranslationSettingsSection extends StatelessWidget {
}
}
String _downloadedModelLabel(
BuildContext context,
TranslationModelRecord model,
) {
final sizeMb = model.fileSizeBytes / (1024 * 1024);
final source = model.sourceUrl.isEmpty ? model.name : model.sourceUrl;
return context.l10n.translation_downloadedModelDetails(
sizeMb.toStringAsFixed(1),
source,
String _displayName(String sourceUrl, String? fileName, String? id) {
for (final preset in translationPresetModels) {
if (preset.id == id || preset.sourceUrl == sourceUrl) {
return translationModelFriendlyName(preset);
}
}
final name = (fileName != null && fileName.isNotEmpty)
? fileName
: _fileNameFromUrl(sourceUrl);
return translationModelFriendlyName(
TranslationModelRecord(
id: id ?? name,
name: name,
sourceUrl: sourceUrl,
localPath: '',
downloadedAt: DateTime.fromMillisecondsSinceEpoch(0),
fileSizeBytes: 0,
),
);
}
String _fileNameFromUrl(String sourceUrl) {
final uri = Uri.tryParse(sourceUrl);
if (uri == null || uri.pathSegments.isEmpty) {
return context.l10n.translation_defaultModelName;
}
final last = uri.pathSegments.last.trim();
if (last.isEmpty) return context.l10n.translation_defaultModelName;
return last;
}
}
/// Owns the [TextEditingController] for the manual model URL field so it
@@ -441,21 +504,15 @@ class _TranslationUrlField extends StatefulWidget {
required this.initialValue,
required this.onChanged,
required this.onDownload,
required this.downloadLabel,
required this.isDownloading,
required this.onCancel,
required this.labelText,
required this.stopLabel,
required this.downloadTooltip,
});
final String initialValue;
final ValueChanged<String> onChanged;
final void Function(String url)? onDownload;
final String downloadLabel;
final bool isDownloading;
final VoidCallback onCancel;
final String labelText;
final String stopLabel;
final String downloadTooltip;
@override
State<_TranslationUrlField> createState() => _TranslationUrlFieldState();
@@ -478,39 +535,26 @@ class _TranslationUrlFieldState extends State<_TranslationUrlField> {
@override
Widget build(BuildContext context) {
return Column(
children: [
TextField(
controller: _controller,
decoration: InputDecoration(
labelText: widget.labelText,
border: const OutlineInputBorder(),
),
onChanged: widget.onChanged,
return TextField(
controller: _controller,
keyboardType: TextInputType.url,
autocorrect: false,
enableSuggestions: false,
decoration: InputDecoration(
labelText: widget.labelText,
border: const OutlineInputBorder(),
suffixIcon: IconButton(
tooltip: widget.downloadTooltip,
onPressed: widget.onDownload == null
? null
: () => widget.onDownload!(_controller.text.trim()),
icon: const Icon(Icons.download_outlined),
),
const SizedBox(height: 8),
Row(
children: [
Expanded(
child: FilledButton.icon(
onPressed: widget.onDownload == null
? null
: () => widget.onDownload!(_controller.text.trim()),
icon: const Icon(Icons.download),
label: Text(widget.downloadLabel),
),
),
if (widget.isDownloading) ...[
const SizedBox(width: 8),
OutlinedButton.icon(
onPressed: widget.onCancel,
icon: const Icon(Icons.stop_circle_outlined),
label: Text(widget.stopLabel),
),
],
],
),
],
),
onChanged: widget.onChanged,
onSubmitted: widget.onDownload == null
? null
: (value) => widget.onDownload!(value.trim()),
);
}
}