From 9ffdbaae09e19f7bb019c47e2fe6f0b2995cb84b Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sat, 21 Nov 2026 00:05:39 +0000 Subject: [PATCH] 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 --- documentation/design.md | 17 + documentation/image-messages.md | 2 +- documentation/settings.md | 6 +- lib/l10n/app_bg.arb | 13 +- lib/l10n/app_cs.arb | 13 +- lib/l10n/app_de.arb | 13 +- lib/l10n/app_en.arb | 28 +- lib/l10n/app_es.arb | 13 +- lib/l10n/app_fr.arb | 13 +- lib/l10n/app_hu.arb | 13 +- lib/l10n/app_it.arb | 13 +- lib/l10n/app_ja.arb | 13 +- lib/l10n/app_ko.arb | 13 +- lib/l10n/app_localizations.dart | 58 +- lib/l10n/app_localizations_bg.dart | 36 +- lib/l10n/app_localizations_cs.dart | 36 +- lib/l10n/app_localizations_de.dart | 36 +- lib/l10n/app_localizations_en.dart | 36 +- lib/l10n/app_localizations_es.dart | 36 +- lib/l10n/app_localizations_fr.dart | 36 +- lib/l10n/app_localizations_hu.dart | 36 +- lib/l10n/app_localizations_it.dart | 36 +- lib/l10n/app_localizations_ja.dart | 36 +- lib/l10n/app_localizations_ko.dart | 36 +- lib/l10n/app_localizations_nl.dart | 36 +- lib/l10n/app_localizations_pl.dart | 36 +- lib/l10n/app_localizations_pt.dart | 72 +- lib/l10n/app_localizations_ru.dart | 36 +- lib/l10n/app_localizations_sk.dart | 36 +- lib/l10n/app_localizations_sl.dart | 36 +- lib/l10n/app_localizations_sv.dart | 36 +- lib/l10n/app_localizations_uk.dart | 36 +- lib/l10n/app_localizations_zh.dart | 35 +- lib/l10n/app_nl.arb | 13 +- lib/l10n/app_pl.arb | 13 +- lib/l10n/app_pt.arb | 13 +- lib/l10n/app_pt_PT.arb | 13 +- lib/l10n/app_ru.arb | 13 +- lib/l10n/app_sk.arb | 13 +- lib/l10n/app_sl.arb | 13 +- lib/l10n/app_sv.arb | 13 +- lib/l10n/app_uk.arb | 13 +- lib/l10n/app_zh.arb | 13 +- lib/screens/app_settings_screen.dart | 168 +---- lib/screens/backup_restore_screen.dart | 143 +++- lib/widgets/image_codec_models_section.dart | 297 ++++++++ lib/widgets/model_download_list.dart | 338 +++++++++ lib/widgets/translation_settings_section.dart | 688 ++++++++++-------- test/widgets/model_download_list_test.dart | 302 ++++++++ untranslated.json | 344 ++++----- 50 files changed, 2524 insertions(+), 833 deletions(-) create mode 100644 lib/widgets/image_codec_models_section.dart create mode 100644 lib/widgets/model_download_list.dart create mode 100644 test/widgets/model_download_list_test.dart diff --git a/documentation/design.md b/documentation/design.md index 423b53aa..4121061e 100644 --- a/documentation/design.md +++ b/documentation/design.md @@ -122,6 +122,7 @@ Icon sizes in use: 24 for tile and banner icons, 20 for menu icons and small act | Popup menu row | **always** `PopupMenuItem(child: MeshMenuItemRow(icon:, label:))` | Label wraps to 2 lines then ellipsizes; `leading:` for `ThemedIcon`; no icon keeps the 20px slot | | Segmented button label | **always** `ButtonSegment(label: MeshSegmentLabel(text))` | Shrinks to 12 (before system scale), then wraps at word boundaries onto 2 centred lines; never breaks a word | | Status | `StatusChip` | Mono label, coloured dot or icon | +| On-device model | `ModelDownloadList` | Name, size, status, selection and one action. See [Model downloads](#model-downloads). | | Metric | `StatTile` | Label wraps to 2 lines; value wraps | | Signal | `SignalBars`, `MeshTheme.snrColor` | | | Route kind | `RouteChip` | Direct / hop count / Flood | @@ -147,6 +148,22 @@ Icon sizes in use: 24 for tile and banner icons, 20 for menu icons and small act **IconButton.** Always set `tooltip:` with a localized string. It is the accessible name. +### Model downloads + +Image models, translation models, and the restore prompt that fetches missing models all use `ModelDownloadList` (`lib/widgets/model_download_list.dart`). Do not add a second download form (a dropdown of presets, a separate filename row, or a one-off progress bar). + +One model is one row inside the existing `MeshCard`, rows separated by `Divider(height: 1, indent: 16)`: + +| Part | What it shows | +|---|---| +| Title | Friendly name, `meshTileTitleStyle` (`bodyLarge` w600). It wraps. Never a raw filename or URL. | +| Subtitle | Size via the `mapCache_size*` strings when known, then the status: Not downloaded, Downloading, Ready, or Couldn't download. The model in use also says Active. An install that stopped part-way says Incomplete. The words stay `onSurfaceVariant` (Active is w600). The leading icon carries the colour: `primary` when that model is active or downloading, `error` on failure, `onSurfaceVariant` otherwise. | +| Progress | While downloading, a `LinearProgressIndicator` (indeterminate when the total is unknown, or while chunks are merged or the file is verified) and a mono 12 caption of bytes and percent. | +| Action | One `IconButton` with a localized tooltip: Download, Cancel, or Remove model. An install that already has files but is not ready shows both Download and Remove. Tap a Ready row to select it when more than one model can be active. A row the user cannot use is dimmed to 50 %, same as a disabled `MeshNavTile`. | +| Manual URL | When the feature accepts one (translation), put a single text field under the list. Its download control is the same Download icon. The file joins this list. | + +A dialog that offers several missing models (backup restore) uses the same rows for name, size, status and progress, and keeps its own confirm button. + ## 6. Sheets, dialogs and pages What the code does: diff --git a/documentation/image-messages.md b/documentation/image-messages.md index 935dd398..2725ed4d 100644 --- a/documentation/image-messages.md +++ b/documentation/image-messages.md @@ -9,7 +9,7 @@ MeshCore Open can send a highly compressed image as channel GRP_DATA packets. Un - The image model bundle installed through App Settings → Image model, and Enable image messages turned on. - Enough storage for the roughly 1 GB bundle and enough available memory for reconstruction, which can peak above 2 GB. Actual latency and memory usage depend on hardware. -Downloads use the configured Hugging Face model bundle, support resume, and verify file checksums. Download the model while internet is available. Once installed, encoding and reconstruction run locally; photos are not uploaded for inference. Compatible recipients need the same supported codec/model format. +Downloads use the configured Hugging Face model bundle, support resume, and verify file checksums. App Settings shows that bundle as one model row — name, size, and status — the same row used for translation models. Download the model while internet is available. Once installed, encoding and reconstruction run locally; photos are not uploaded for inference. Compatible recipients need the same supported codec/model format. ## Send an image diff --git a/documentation/settings.md b/documentation/settings.md index 3f101f07..a785b4dd 100644 --- a/documentation/settings.md +++ b/documentation/settings.md @@ -153,9 +153,7 @@ Not shown on web. Controls on-device message translation powered by a locally-do - **Auto-translate incoming messages**: Automatically translates incoming messages for chat/channel display and notifications - **Translate before sending**: Sets the default state of the composer's translate icon (on means messages are translated before sending) - **Target language**: Language to translate into (searchable list; defaults to the app language) -- **Downloaded model**: Dropdown to select among already-downloaded translation models -- **Preset Hugging Face model**: Download a curated preset model with one tap -- **Manual model URL**: Enter a URL to download a custom GGUF-format model; shows download progress and a cancel button +- **Models**: The same model rows used for the image codec. Each preset is one row with its name, size once known, and status (not downloaded, downloading with progress, ready, or couldn't download). The model in use is marked Active; tap another ready row to switch. Download, cancel, and remove are the row's action. A manual model URL under the list downloads a custom GGUF file into the same list. The auto-translate and composer toggles are disabled until **Enable translation** is on. @@ -175,7 +173,7 @@ Save the settings before sharing. The upload action is shown in the chat compose ### Image Messages -Image message controls live in App Settings → Messaging. Turn on **Enable image messages** first; **Process images automatically** and the image model download/cancel/removal controls then appear. Automatic processing reconstructs every image as it arrives and uses about 2 GB of memory for a second each time; leave it off to reconstruct with a tap. See [Image Messages](image-messages.md) for firmware, native-runtime, storage, and memory requirements. +Image message controls live in App Settings → Messaging. Turn on **Enable image messages** first; **Process images automatically** and the image model row then appear. That row is the same model list used for translation: name, size, status (not downloaded, downloading with progress, ready, or couldn't download), and one action (download, cancel, or remove). A finished install is marked Active. Automatic processing reconstructs every image as it arrives and uses about 2 GB of memory for a second each time; leave it off to reconstruct with a tap. See [Image Messages](image-messages.md) for firmware, native-runtime, storage, and memory requirements. ### Cyrillic-to-Latin (Cyr2Lat) Controls character substitution profiles used to render Cyrillic text in Latin characters. A dropdown selects the active profile; Add, Edit, and Delete buttons manage the profile list (the last remaining profile cannot be deleted). Each profile stores a JSON character map. diff --git a/lib/l10n/app_bg.arb b/lib/l10n/app_bg.arb index 913a0815..90289d2c 100644 --- a/lib/l10n/app_bg.arb +++ b/lib/l10n/app_bg.arb @@ -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}%)" } diff --git a/lib/l10n/app_cs.arb b/lib/l10n/app_cs.arb index f72e9821..04ead9b8 100644 --- a/lib/l10n/app_cs.arb +++ b/lib/l10n/app_cs.arb @@ -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}%)" } diff --git a/lib/l10n/app_de.arb b/lib/l10n/app_de.arb index 40d00f84..6a8faacd 100644 --- a/lib/l10n/app_de.arb +++ b/lib/l10n/app_de.arb @@ -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}%)" } diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb index e18f6ed9..72b1dcde 100644 --- a/lib/l10n/app_en.arb +++ b/lib/l10n/app_en.arb @@ -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"} + } } } diff --git a/lib/l10n/app_es.arb b/lib/l10n/app_es.arb index 1b0ddb11..17893440 100644 --- a/lib/l10n/app_es.arb +++ b/lib/l10n/app_es.arb @@ -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}%)" } diff --git a/lib/l10n/app_fr.arb b/lib/l10n/app_fr.arb index de3c1be3..fb3a3cd2 100644 --- a/lib/l10n/app_fr.arb +++ b/lib/l10n/app_fr.arb @@ -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}%)" } diff --git a/lib/l10n/app_hu.arb b/lib/l10n/app_hu.arb index ba73a0d6..4d279f40 100644 --- a/lib/l10n/app_hu.arb +++ b/lib/l10n/app_hu.arb @@ -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}%)" } diff --git a/lib/l10n/app_it.arb b/lib/l10n/app_it.arb index 8d6bd2ec..f23bd6ef 100644 --- a/lib/l10n/app_it.arb +++ b/lib/l10n/app_it.arb @@ -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}%)" } diff --git a/lib/l10n/app_ja.arb b/lib/l10n/app_ja.arb index 0a3b8931..926d2f6a 100644 --- a/lib/l10n/app_ja.arb +++ b/lib/l10n/app_ja.arb @@ -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}%)" } diff --git a/lib/l10n/app_ko.arb b/lib/l10n/app_ko.arb index dcaf27a3..26567d26 100644 --- a/lib/l10n/app_ko.arb +++ b/lib/l10n/app_ko.arb @@ -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}%)" } diff --git a/lib/l10n/app_localizations.dart b/lib/l10n/app_localizations.dart index 53e641fa..49389905 100644 --- a/lib/l10n/app_localizations.dart +++ b/lib/l10n/app_localizations.dart @@ -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 diff --git a/lib/l10n/app_localizations_bg.dart b/lib/l10n/app_localizations_bg.dart index cc0a9670..f500aa6a 100644 --- a/lib/l10n/app_localizations_bg.dart +++ b/lib/l10n/app_localizations_bg.dart @@ -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%)'; + } } diff --git a/lib/l10n/app_localizations_cs.dart b/lib/l10n/app_localizations_cs.dart index 60ad5ee3..9f813b1e 100644 --- a/lib/l10n/app_localizations_cs.dart +++ b/lib/l10n/app_localizations_cs.dart @@ -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%)'; + } } diff --git a/lib/l10n/app_localizations_de.dart b/lib/l10n/app_localizations_de.dart index 587287f7..882f2740 100644 --- a/lib/l10n/app_localizations_de.dart +++ b/lib/l10n/app_localizations_de.dart @@ -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%)'; + } } diff --git a/lib/l10n/app_localizations_en.dart b/lib/l10n/app_localizations_en.dart index f73db6d1..d46c8fa6 100644 --- a/lib/l10n/app_localizations_en.dart +++ b/lib/l10n/app_localizations_en.dart @@ -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%)'; + } } diff --git a/lib/l10n/app_localizations_es.dart b/lib/l10n/app_localizations_es.dart index 8dd0aa61..67112b9d 100644 --- a/lib/l10n/app_localizations_es.dart +++ b/lib/l10n/app_localizations_es.dart @@ -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%)'; + } } diff --git a/lib/l10n/app_localizations_fr.dart b/lib/l10n/app_localizations_fr.dart index 9e1cde19..e18b6375 100644 --- a/lib/l10n/app_localizations_fr.dart +++ b/lib/l10n/app_localizations_fr.dart @@ -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%)'; + } } diff --git a/lib/l10n/app_localizations_hu.dart b/lib/l10n/app_localizations_hu.dart index fae906b6..a738147f 100644 --- a/lib/l10n/app_localizations_hu.dart +++ b/lib/l10n/app_localizations_hu.dart @@ -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%)'; + } } diff --git a/lib/l10n/app_localizations_it.dart b/lib/l10n/app_localizations_it.dart index 9d96718d..d498db18 100644 --- a/lib/l10n/app_localizations_it.dart +++ b/lib/l10n/app_localizations_it.dart @@ -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%)'; + } } diff --git a/lib/l10n/app_localizations_ja.dart b/lib/l10n/app_localizations_ja.dart index 10908f1e..6084fd6a 100644 --- a/lib/l10n/app_localizations_ja.dart +++ b/lib/l10n/app_localizations_ja.dart @@ -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%)'; + } } diff --git a/lib/l10n/app_localizations_ko.dart b/lib/l10n/app_localizations_ko.dart index 2ed52089..169fa074 100644 --- a/lib/l10n/app_localizations_ko.dart +++ b/lib/l10n/app_localizations_ko.dart @@ -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%)'; + } } diff --git a/lib/l10n/app_localizations_nl.dart b/lib/l10n/app_localizations_nl.dart index cc092841..22ea472a 100644 --- a/lib/l10n/app_localizations_nl.dart +++ b/lib/l10n/app_localizations_nl.dart @@ -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%)'; + } } diff --git a/lib/l10n/app_localizations_pl.dart b/lib/l10n/app_localizations_pl.dart index 62a18751..077362d4 100644 --- a/lib/l10n/app_localizations_pl.dart +++ b/lib/l10n/app_localizations_pl.dart @@ -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%)'; + } } diff --git a/lib/l10n/app_localizations_pt.dart b/lib/l10n/app_localizations_pt.dart index 48a93255..65b872a8 100644 --- a/lib/l10n/app_localizations_pt.dart +++ b/lib/l10n/app_localizations_pt.dart @@ -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%)'; + } } diff --git a/lib/l10n/app_localizations_ru.dart b/lib/l10n/app_localizations_ru.dart index b2d7a486..253fcc4a 100644 --- a/lib/l10n/app_localizations_ru.dart +++ b/lib/l10n/app_localizations_ru.dart @@ -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%)'; + } } diff --git a/lib/l10n/app_localizations_sk.dart b/lib/l10n/app_localizations_sk.dart index 0c1327b4..c6e2170b 100644 --- a/lib/l10n/app_localizations_sk.dart +++ b/lib/l10n/app_localizations_sk.dart @@ -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%)'; + } } diff --git a/lib/l10n/app_localizations_sl.dart b/lib/l10n/app_localizations_sl.dart index 3701f9e0..1981b559 100644 --- a/lib/l10n/app_localizations_sl.dart +++ b/lib/l10n/app_localizations_sl.dart @@ -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%)'; + } } diff --git a/lib/l10n/app_localizations_sv.dart b/lib/l10n/app_localizations_sv.dart index 9aa969ce..b64474ed 100644 --- a/lib/l10n/app_localizations_sv.dart +++ b/lib/l10n/app_localizations_sv.dart @@ -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%)'; + } } diff --git a/lib/l10n/app_localizations_uk.dart b/lib/l10n/app_localizations_uk.dart index de2125bc..d8a201eb 100644 --- a/lib/l10n/app_localizations_uk.dart +++ b/lib/l10n/app_localizations_uk.dart @@ -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%)'; + } } diff --git a/lib/l10n/app_localizations_zh.dart b/lib/l10n/app_localizations_zh.dart index 241d78de..813bb0e6 100644 --- a/lib/l10n/app_localizations_zh.dart +++ b/lib/l10n/app_localizations_zh.dart @@ -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%)'; + } } diff --git a/lib/l10n/app_nl.arb b/lib/l10n/app_nl.arb index 2f192869..e042f095 100644 --- a/lib/l10n/app_nl.arb +++ b/lib/l10n/app_nl.arb @@ -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}%)" } diff --git a/lib/l10n/app_pl.arb b/lib/l10n/app_pl.arb index af3783a1..2f17da61 100644 --- a/lib/l10n/app_pl.arb +++ b/lib/l10n/app_pl.arb @@ -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}%)" } diff --git a/lib/l10n/app_pt.arb b/lib/l10n/app_pt.arb index ad24e07a..c8290e33 100644 --- a/lib/l10n/app_pt.arb +++ b/lib/l10n/app_pt.arb @@ -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}%)" } diff --git a/lib/l10n/app_pt_PT.arb b/lib/l10n/app_pt_PT.arb index 80218599..727d5453 100644 --- a/lib/l10n/app_pt_PT.arb +++ b/lib/l10n/app_pt_PT.arb @@ -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}%)" } diff --git a/lib/l10n/app_ru.arb b/lib/l10n/app_ru.arb index f5ff336c..e373cc42 100644 --- a/lib/l10n/app_ru.arb +++ b/lib/l10n/app_ru.arb @@ -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}%)" } diff --git a/lib/l10n/app_sk.arb b/lib/l10n/app_sk.arb index c582c8f4..9c99b28d 100644 --- a/lib/l10n/app_sk.arb +++ b/lib/l10n/app_sk.arb @@ -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}%)" } diff --git a/lib/l10n/app_sl.arb b/lib/l10n/app_sl.arb index 3dcbeb94..066e800a 100644 --- a/lib/l10n/app_sl.arb +++ b/lib/l10n/app_sl.arb @@ -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}%)" } diff --git a/lib/l10n/app_sv.arb b/lib/l10n/app_sv.arb index 7ec4e120..3beec8a0 100644 --- a/lib/l10n/app_sv.arb +++ b/lib/l10n/app_sv.arb @@ -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}%)" } diff --git a/lib/l10n/app_uk.arb b/lib/l10n/app_uk.arb index 16d0ca20..64caefb0 100644 --- a/lib/l10n/app_uk.arb +++ b/lib/l10n/app_uk.arb @@ -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}%)" } diff --git a/lib/l10n/app_zh.arb b/lib/l10n/app_zh.arb index 6b70ddb0..ce91a452 100644 --- a/lib/l10n/app_zh.arb +++ b/lib/l10n/app_zh.arb @@ -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}%)" } diff --git a/lib/screens/app_settings_screen.dart b/lib/screens/app_settings_screen.dart index 126216cb..f1e822c8 100644 --- a/lib/screens/app_settings_screen.dart +++ b/lib/screens/app_settings_screen.dart @@ -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(); - } 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 _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, diff --git a/lib/screens/backup_restore_screen.dart b/lib/screens/backup_restore_screen.dart index 6a39f46a..02989aff 100644 --- a/lib/screens/backup_restore_screen.dart +++ b/lib/screens/backup_restore_screen.dart @@ -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 { 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 { 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 { }, 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 { 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, + ); +} diff --git a/lib/widgets/image_codec_models_section.dart b/lib/widgets/image_codec_models_section.dart new file mode 100644 index 00000000..66770288 --- /dev/null +++ b/lib/widgets/image_codec_models_section.dart @@ -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 createState() => + _ImageCodecModelsSectionState(); +} + +class _ImageCodecModelsSectionState extends State { + String? _failedId; + String? _failedDetail; + + @override + Widget build(BuildContext context) { + final codec = context.watch(); + 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 _items( + BuildContext context, + ImageCodecService codec, + ) { + final models = codec.availableModels; + final used = {}; + final items = []; + + 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 _download(ImageCodecModelSpec spec) async { + setState(() { + _failedId = null; + _failedDetail = null; + }); + final l10n = context.l10n; + try { + await context.read().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 _delete(ImageCodecModelRecord model) async { + final l10n = context.l10n; + try { + await context.read().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 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; +} diff --git a/lib/widgets/model_download_list.dart b/lib/widgets/model_download_list.dart new file mode 100644 index 00000000..847c2fd3 --- /dev/null +++ b/lib/widgets/model_download_list.dart @@ -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 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 _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 = []; + 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, + ); + } +} diff --git a/lib/widgets/translation_settings_section.dart b/lib/widgets/translation_settings_section.dart index dd8c6ac5..9d68c26f 100644 --- a/lib/widgets/translation_settings_section.dart +++ b/lib/widgets/translation_settings_section.dart @@ -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(); - final translationService = context.watch(); 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( - 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( - 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 _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(); + final translationService = context.watch(); 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 _deleteTranslationModel( - BuildContext context, + List _items( + AppLocalizations l10n, + AppSettings settings, + AppSettingsService settingsService, + TranslationService service, + ) { + final downloaded = settings.translationDownloadedModels; + final selectedId = settings.translationSelectedModelId; + final pending = _pending; + final used = {}; + final items = []; + 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 _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(); + final translationService = context.read(); + 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 _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 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()), ); } } diff --git a/test/widgets/model_download_list_test.dart b/test/widgets/model_download_list_test.dart new file mode 100644 index 00000000..def521b1 --- /dev/null +++ b/test/widgets/model_download_list_test.dart @@ -0,0 +1,302 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:meshcore_open/l10n/app_localizations.dart'; +import 'package:meshcore_open/models/image_codec_support.dart'; +import 'package:meshcore_open/models/translation_support.dart'; +import 'package:meshcore_open/services/app_settings_service.dart'; +import 'package:meshcore_open/services/image_codec_service.dart'; +import 'package:meshcore_open/services/image_codec_settings_store.dart'; +import 'package:meshcore_open/services/translation_service.dart'; +import 'package:meshcore_open/storage/prefs_manager.dart'; +import 'package:meshcore_open/theme/mesh_theme.dart'; +import 'package:meshcore_open/widgets/image_codec_models_section.dart'; +import 'package:meshcore_open/widgets/model_download_list.dart'; +import 'package:meshcore_open/widgets/translation_settings_section.dart'; +import 'package:provider/provider.dart'; +import 'package:provider/single_child_widget.dart'; +import 'package:shared_preferences/shared_preferences.dart'; + +void main() { + TestWidgetsFlutterBinding.ensureInitialized(); + + setUp(() async { + SharedPreferences.setMockInitialValues({}); + PrefsManager.reset(); + await PrefsManager.initialize(); + }); + + Future pump( + WidgetTester tester, + Widget home, { + List providers = const [], + double textScale = 1, + Size size = const Size(400, 900), + }) async { + tester.view.physicalSize = size; + tester.view.devicePixelRatio = 1; + addTearDown(tester.view.reset); + final app = MaterialApp( + theme: MeshTheme.dark(), + locale: const Locale('en'), + localizationsDelegates: AppLocalizations.localizationsDelegates, + supportedLocales: AppLocalizations.supportedLocales, + builder: (context, child) => MediaQuery( + data: MediaQuery.of( + context, + ).copyWith(textScaler: TextScaler.linear(textScale)), + child: child!, + ), + home: Scaffold(body: SingleChildScrollView(child: home)), + ); + await tester.pumpWidget( + providers.isEmpty ? app : MultiProvider(providers: providers, child: app), + ); + } + + testWidgets('rows share name, size, status and one action', (tester) async { + var downloaded = 0; + var cancelled = 0; + var removed = 0; + var selected = 0; + await pump( + tester, + ModelDownloadList( + items: [ + ModelDownloadItem( + id: 'new', + name: 'Preset model', + sizeBytes: 958 * 1024 * 1024, + status: ModelDownloadStatus.notDownloaded, + onDownload: () => downloaded++, + ), + ModelDownloadItem( + id: 'busy', + name: 'Preset model', + sizeBytes: 958 * 1024 * 1024, + status: ModelDownloadStatus.downloading, + progress: 0.4, + downloadedBytes: 400 * 1024 * 1024, + totalBytes: 958 * 1024 * 1024, + onCancel: () => cancelled++, + ), + ModelDownloadItem( + id: 'ready', + name: 'Installed model', + sizeBytes: 1100 * 1024 * 1024, + status: ModelDownloadStatus.ready, + selected: true, + onDelete: () => removed++, + onSelect: () => selected++, + ), + ModelDownloadItem( + id: 'bad', + name: 'Broken model', + status: ModelDownloadStatus.error, + detail: 'HTTP 404', + onDownload: () => downloaded++, + ), + ], + ), + ); + + expect(find.textContaining('958 MB'), findsWidgets); + expect(find.textContaining('Not downloaded'), findsOneWidget); + expect(find.textContaining('Downloading'), findsOneWidget); + expect(find.textContaining('Ready'), findsOneWidget); + expect(find.textContaining('Active'), findsOneWidget); + expect(find.textContaining("Couldn't download"), findsOneWidget); + expect(find.text('HTTP 404'), findsOneWidget); + expect(find.textContaining('400.0 / 958.0 MB (40%)'), findsOneWidget); + expect(find.byType(LinearProgressIndicator), findsOneWidget); + expect(find.textContaining('http'), findsNothing); + + await tester.tap(find.byKey(const ValueKey('model-download-new'))); + await tester.tap(find.byKey(const ValueKey('model-cancel-busy'))); + await tester.tap(find.byKey(const ValueKey('model-remove-ready'))); + await tester.tap(find.text('Installed model')); + expect(downloaded, 1); + expect(cancelled, 1); + expect(removed, 1); + // The ready row is already selected, so onSelect is still wired here and + // the row tap invokes it. Callers omit onSelect once it is active. + expect(selected, 1); + }); + + testWidgets('a long row wraps at 320dp and text scale 2', (tester) async { + final overflows = []; + final previous = FlutterError.onError; + FlutterError.onError = (details) { + if (details.exceptionAsString().contains('overflowed')) { + overflows.add(details.exceptionAsString().split('\n').first); + return; + } + previous?.call(details); + }; + addTearDown(() => FlutterError.onError = previous); + + await pump( + tester, + ModelDownloadList( + items: [ + ModelDownloadItem( + id: 'long', + name: 'Tencent HY-MT 1.5 1.8B Q4_K_M', + sizeBytes: 1140000000, + status: ModelDownloadStatus.downloading, + progress: 0.2, + downloadedBytes: 200 * 1024 * 1024, + totalBytes: 1140000000, + onCancel: () {}, + ), + ], + ), + textScale: 2, + size: const Size(320, 568), + ); + expect(overflows, isEmpty); + expect(find.text('Tencent HY-MT 1.5 1.8B Q4_K_M'), findsOneWidget); + }); + + testWidgets('translation presets and installs share one list', ( + tester, + ) async { + final settings = AppSettingsService(); + await settings.loadSettings(); + final preset = translationPresetModels.first; + final other = translationPresetModels[1]; + await settings.setTranslationDownloadedModels([ + TranslationModelRecord( + id: preset.id, + name: preset.name, + sourceUrl: preset.sourceUrl, + localPath: '/tmp/model.gguf', + downloadedAt: DateTime.utc(2026, 1, 1), + fileSizeBytes: 1140000000, + ), + TranslationModelRecord( + id: other.id, + name: other.name, + sourceUrl: other.sourceUrl, + localPath: '/tmp/other.gguf', + downloadedAt: DateTime.utc(2026, 1, 2), + fileSizeBytes: 1400 * 1024 * 1024, + ), + ]); + await settings.setTranslationSelectedModelId(preset.id); + final translation = TranslationService(settings); + + await pump( + tester, + const TranslationSettingsSection(), + providers: [ + ChangeNotifierProvider.value(value: settings), + ChangeNotifierProvider.value(value: translation), + ], + ); + + expect(find.text('Tencent HY-MT 1.5 1.8B Q4_K_M'), findsOneWidget); + expect(find.text('Tencent HY-MT 1.5 1.8B Q6_K'), findsOneWidget); + expect(find.textContaining('Ready'), findsNWidgets(2)); + expect(find.textContaining('Active'), findsOneWidget); + expect(find.textContaining('Not downloaded'), findsNothing); + expect(find.text('Downloaded model'), findsNothing); + expect(find.text('Preset Hugging Face model'), findsNothing); + expect(find.text('Manual model URL'), findsOneWidget); + expect(find.textContaining('huggingface.co'), findsNothing); + expect(find.textContaining('.gguf'), findsNothing); + + await tester.tap(find.text('Tencent HY-MT 1.5 1.8B Q6_K')); + await tester.pump(); + expect(settings.settings.translationSelectedModelId, other.id); + + await tester.tap(find.byKey(ValueKey('model-remove-${preset.id}'))); + await tester.pump(); + await tester.pump(const Duration(milliseconds: 50)); + expect( + settings.settings.translationDownloadedModels.map((model) => model.id), + [other.id], + ); + expect(find.textContaining('Not downloaded'), findsOneWidget); + }); + + testWidgets('an installed image bundle is one ready row', (tester) async { + final spec = imageCodecPresetModels.single; + final settings = AppSettingsService(); + final store = InMemoryImageCodecSettingsStore( + ImageCodecPreferences( + enabled: true, + selectedModelId: spec.id, + downloadedModels: [ + ImageCodecModelRecord( + id: spec.id, + name: spec.fileName, + sourceUrl: spec.graph.sourceUrl, + localPath: '/tmp/${spec.fileName}', + downloadedAt: DateTime.utc(2026, 1, 1), + fileSizeBytes: spec.totalSizeBytes, + assetFileNames: [for (final asset in spec.assets) asset.fileName], + assetRoles: { + for (final asset in spec.assets) asset.fileName: asset.role, + }, + bundleVersion: kImageCodecBundleVersion, + ), + ], + ), + ); + final codec = ImageCodecService(settings, settingsStore: store); + + await pump( + tester, + const ImageCodecModelsSection(), + providers: [ + ChangeNotifierProvider.value(value: codec), + ], + ); + + expect(find.text(spec.label), findsOneWidget); + expect(find.textContaining(spec.fileName), findsNothing); + expect(find.textContaining('.onnx'), findsNothing); + expect(find.textContaining('958 MB'), findsOneWidget); + expect(find.textContaining('Ready'), findsOneWidget); + expect(find.textContaining('Active'), findsOneWidget); + expect(find.byTooltip('Remove model'), findsOneWidget); + expect(find.byTooltip('Download'), findsNothing); + }); + + testWidgets('a partial image bundle stays on the preset row', (tester) async { + final spec = imageCodecPresetModels.single; + final settings = AppSettingsService(); + final store = InMemoryImageCodecSettingsStore( + ImageCodecPreferences( + enabled: true, + downloadedModels: [ + ImageCodecModelRecord( + id: spec.id, + name: spec.fileName, + sourceUrl: spec.graph.sourceUrl, + localPath: '/tmp/${spec.fileName}', + downloadedAt: DateTime.utc(2026, 1, 1), + fileSizeBytes: spec.graph.sizeBytes, + assetFileNames: [spec.fileName], + bundleVersion: 0, + ), + ], + ), + ); + final codec = ImageCodecService(settings, settingsStore: store); + + await pump( + tester, + const ImageCodecModelsSection(), + providers: [ + ChangeNotifierProvider.value(value: codec), + ], + ); + + expect(find.text(spec.label), findsOneWidget); + expect(find.textContaining(spec.fileName), findsNothing); + expect(find.textContaining('Incomplete'), findsOneWidget); + expect(find.byTooltip('Download'), findsOneWidget); + expect(find.byTooltip('Remove model'), findsOneWidget); + }); +} diff --git a/untranslated.json b/untranslated.json index 75375aac..bd211125 100644 --- a/untranslated.json +++ b/untranslated.json @@ -12,7 +12,14 @@ "settings_exportBookmarks", "settings_exportBookmarksSubtitle", "settings_exportBookmarksSuccess", - "settings_exportBookmarksNoBookmarks" + "settings_exportBookmarksNoBookmarks", + "receivedImage_packetEchoes", + "receivedImage_recoveryPacketEchoes", + "imageSend_preparingPreview", + "imageSend_tryAnother", + "imageSend_versionsHint", + "imageSend_versionLabel", + "imageSend_versionPackets" ], "cs": [ @@ -28,7 +35,14 @@ "settings_exportBookmarks", "settings_exportBookmarksSubtitle", "settings_exportBookmarksSuccess", - "settings_exportBookmarksNoBookmarks" + "settings_exportBookmarksNoBookmarks", + "receivedImage_packetEchoes", + "receivedImage_recoveryPacketEchoes", + "imageSend_preparingPreview", + "imageSend_tryAnother", + "imageSend_versionsHint", + "imageSend_versionLabel", + "imageSend_versionPackets" ], "de": [ @@ -44,7 +58,14 @@ "settings_exportBookmarks", "settings_exportBookmarksSubtitle", "settings_exportBookmarksSuccess", - "settings_exportBookmarksNoBookmarks" + "settings_exportBookmarksNoBookmarks", + "receivedImage_packetEchoes", + "receivedImage_recoveryPacketEchoes", + "imageSend_preparingPreview", + "imageSend_tryAnother", + "imageSend_versionsHint", + "imageSend_versionLabel", + "imageSend_versionPackets" ], "es": [ @@ -60,7 +81,14 @@ "settings_exportBookmarks", "settings_exportBookmarksSubtitle", "settings_exportBookmarksSuccess", - "settings_exportBookmarksNoBookmarks" + "settings_exportBookmarksNoBookmarks", + "receivedImage_packetEchoes", + "receivedImage_recoveryPacketEchoes", + "imageSend_preparingPreview", + "imageSend_tryAnother", + "imageSend_versionsHint", + "imageSend_versionLabel", + "imageSend_versionPackets" ], "fr": [ @@ -76,7 +104,14 @@ "settings_exportBookmarks", "settings_exportBookmarksSubtitle", "settings_exportBookmarksSuccess", - "settings_exportBookmarksNoBookmarks" + "settings_exportBookmarksNoBookmarks", + "receivedImage_packetEchoes", + "receivedImage_recoveryPacketEchoes", + "imageSend_preparingPreview", + "imageSend_tryAnother", + "imageSend_versionsHint", + "imageSend_versionLabel", + "imageSend_versionPackets" ], "hu": [ @@ -92,7 +127,14 @@ "settings_exportBookmarks", "settings_exportBookmarksSubtitle", "settings_exportBookmarksSuccess", - "settings_exportBookmarksNoBookmarks" + "settings_exportBookmarksNoBookmarks", + "receivedImage_packetEchoes", + "receivedImage_recoveryPacketEchoes", + "imageSend_preparingPreview", + "imageSend_tryAnother", + "imageSend_versionsHint", + "imageSend_versionLabel", + "imageSend_versionPackets" ], "it": [ @@ -108,7 +150,14 @@ "settings_exportBookmarks", "settings_exportBookmarksSubtitle", "settings_exportBookmarksSuccess", - "settings_exportBookmarksNoBookmarks" + "settings_exportBookmarksNoBookmarks", + "receivedImage_packetEchoes", + "receivedImage_recoveryPacketEchoes", + "imageSend_preparingPreview", + "imageSend_tryAnother", + "imageSend_versionsHint", + "imageSend_versionLabel", + "imageSend_versionPackets" ], "ja": [ @@ -124,7 +173,14 @@ "settings_exportBookmarks", "settings_exportBookmarksSubtitle", "settings_exportBookmarksSuccess", - "settings_exportBookmarksNoBookmarks" + "settings_exportBookmarksNoBookmarks", + "receivedImage_packetEchoes", + "receivedImage_recoveryPacketEchoes", + "imageSend_preparingPreview", + "imageSend_tryAnother", + "imageSend_versionsHint", + "imageSend_versionLabel", + "imageSend_versionPackets" ], "ko": [ @@ -140,7 +196,14 @@ "settings_exportBookmarks", "settings_exportBookmarksSubtitle", "settings_exportBookmarksSuccess", - "settings_exportBookmarksNoBookmarks" + "settings_exportBookmarksNoBookmarks", + "receivedImage_packetEchoes", + "receivedImage_recoveryPacketEchoes", + "imageSend_preparingPreview", + "imageSend_tryAnother", + "imageSend_versionsHint", + "imageSend_versionLabel", + "imageSend_versionPackets" ], "nl": [ @@ -156,7 +219,14 @@ "settings_exportBookmarks", "settings_exportBookmarksSubtitle", "settings_exportBookmarksSuccess", - "settings_exportBookmarksNoBookmarks" + "settings_exportBookmarksNoBookmarks", + "receivedImage_packetEchoes", + "receivedImage_recoveryPacketEchoes", + "imageSend_preparingPreview", + "imageSend_tryAnother", + "imageSend_versionsHint", + "imageSend_versionLabel", + "imageSend_versionPackets" ], "pl": [ @@ -172,7 +242,14 @@ "settings_exportBookmarks", "settings_exportBookmarksSubtitle", "settings_exportBookmarksSuccess", - "settings_exportBookmarksNoBookmarks" + "settings_exportBookmarksNoBookmarks", + "receivedImage_packetEchoes", + "receivedImage_recoveryPacketEchoes", + "imageSend_preparingPreview", + "imageSend_tryAnother", + "imageSend_versionsHint", + "imageSend_versionLabel", + "imageSend_versionPackets" ], "pt": [ @@ -188,7 +265,14 @@ "settings_exportBookmarks", "settings_exportBookmarksSubtitle", "settings_exportBookmarksSuccess", - "settings_exportBookmarksNoBookmarks" + "settings_exportBookmarksNoBookmarks", + "receivedImage_packetEchoes", + "receivedImage_recoveryPacketEchoes", + "imageSend_preparingPreview", + "imageSend_tryAnother", + "imageSend_versionsHint", + "imageSend_versionLabel", + "imageSend_versionPackets" ], "pt_PT": [ @@ -204,7 +288,14 @@ "settings_exportBookmarks", "settings_exportBookmarksSubtitle", "settings_exportBookmarksSuccess", - "settings_exportBookmarksNoBookmarks" + "settings_exportBookmarksNoBookmarks", + "receivedImage_packetEchoes", + "receivedImage_recoveryPacketEchoes", + "imageSend_preparingPreview", + "imageSend_tryAnother", + "imageSend_versionsHint", + "imageSend_versionLabel", + "imageSend_versionPackets" ], "ru": [ @@ -220,7 +311,14 @@ "settings_exportBookmarks", "settings_exportBookmarksSubtitle", "settings_exportBookmarksSuccess", - "settings_exportBookmarksNoBookmarks" + "settings_exportBookmarksNoBookmarks", + "receivedImage_packetEchoes", + "receivedImage_recoveryPacketEchoes", + "imageSend_preparingPreview", + "imageSend_tryAnother", + "imageSend_versionsHint", + "imageSend_versionLabel", + "imageSend_versionPackets" ], "sk": [ @@ -236,7 +334,14 @@ "settings_exportBookmarks", "settings_exportBookmarksSubtitle", "settings_exportBookmarksSuccess", - "settings_exportBookmarksNoBookmarks" + "settings_exportBookmarksNoBookmarks", + "receivedImage_packetEchoes", + "receivedImage_recoveryPacketEchoes", + "imageSend_preparingPreview", + "imageSend_tryAnother", + "imageSend_versionsHint", + "imageSend_versionLabel", + "imageSend_versionPackets" ], "sl": [ @@ -252,7 +357,14 @@ "settings_exportBookmarks", "settings_exportBookmarksSubtitle", "settings_exportBookmarksSuccess", - "settings_exportBookmarksNoBookmarks" + "settings_exportBookmarksNoBookmarks", + "receivedImage_packetEchoes", + "receivedImage_recoveryPacketEchoes", + "imageSend_preparingPreview", + "imageSend_tryAnother", + "imageSend_versionsHint", + "imageSend_versionLabel", + "imageSend_versionPackets" ], "sv": [ @@ -268,7 +380,14 @@ "settings_exportBookmarks", "settings_exportBookmarksSubtitle", "settings_exportBookmarksSuccess", - "settings_exportBookmarksNoBookmarks" + "settings_exportBookmarksNoBookmarks", + "receivedImage_packetEchoes", + "receivedImage_recoveryPacketEchoes", + "imageSend_preparingPreview", + "imageSend_tryAnother", + "imageSend_versionsHint", + "imageSend_versionLabel", + "imageSend_versionPackets" ], "uk": [ @@ -284,7 +403,14 @@ "settings_exportBookmarks", "settings_exportBookmarksSubtitle", "settings_exportBookmarksSuccess", - "settings_exportBookmarksNoBookmarks" + "settings_exportBookmarksNoBookmarks", + "receivedImage_packetEchoes", + "receivedImage_recoveryPacketEchoes", + "imageSend_preparingPreview", + "imageSend_tryAnother", + "imageSend_versionsHint", + "imageSend_versionLabel", + "imageSend_versionPackets" ], "zh": [ @@ -300,187 +426,7 @@ "settings_exportBookmarks", "settings_exportBookmarksSubtitle", "settings_exportBookmarksSuccess", - "settings_exportBookmarksNoBookmarks" - "receivedImage_packetEchoes", - "receivedImage_recoveryPacketEchoes", - "imageSend_preparingPreview", - "imageSend_tryAnother", - "imageSend_versionsHint", - "imageSend_versionLabel", - "imageSend_versionPackets" - ], - - "cs": [ - "receivedImage_packetEchoes", - "receivedImage_recoveryPacketEchoes", - "imageSend_preparingPreview", - "imageSend_tryAnother", - "imageSend_versionsHint", - "imageSend_versionLabel", - "imageSend_versionPackets" - ], - - "de": [ - "receivedImage_packetEchoes", - "receivedImage_recoveryPacketEchoes", - "imageSend_preparingPreview", - "imageSend_tryAnother", - "imageSend_versionsHint", - "imageSend_versionLabel", - "imageSend_versionPackets" - ], - - "es": [ - "receivedImage_packetEchoes", - "receivedImage_recoveryPacketEchoes", - "imageSend_preparingPreview", - "imageSend_tryAnother", - "imageSend_versionsHint", - "imageSend_versionLabel", - "imageSend_versionPackets" - ], - - "fr": [ - "receivedImage_packetEchoes", - "receivedImage_recoveryPacketEchoes", - "imageSend_preparingPreview", - "imageSend_tryAnother", - "imageSend_versionsHint", - "imageSend_versionLabel", - "imageSend_versionPackets" - ], - - "hu": [ - "receivedImage_packetEchoes", - "receivedImage_recoveryPacketEchoes", - "imageSend_preparingPreview", - "imageSend_tryAnother", - "imageSend_versionsHint", - "imageSend_versionLabel", - "imageSend_versionPackets" - ], - - "it": [ - "receivedImage_packetEchoes", - "receivedImage_recoveryPacketEchoes", - "imageSend_preparingPreview", - "imageSend_tryAnother", - "imageSend_versionsHint", - "imageSend_versionLabel", - "imageSend_versionPackets" - ], - - "ja": [ - "receivedImage_packetEchoes", - "receivedImage_recoveryPacketEchoes", - "imageSend_preparingPreview", - "imageSend_tryAnother", - "imageSend_versionsHint", - "imageSend_versionLabel", - "imageSend_versionPackets" - ], - - "ko": [ - "receivedImage_packetEchoes", - "receivedImage_recoveryPacketEchoes", - "imageSend_preparingPreview", - "imageSend_tryAnother", - "imageSend_versionsHint", - "imageSend_versionLabel", - "imageSend_versionPackets" - ], - - "nl": [ - "receivedImage_packetEchoes", - "receivedImage_recoveryPacketEchoes", - "imageSend_preparingPreview", - "imageSend_tryAnother", - "imageSend_versionsHint", - "imageSend_versionLabel", - "imageSend_versionPackets" - ], - - "pl": [ - "receivedImage_packetEchoes", - "receivedImage_recoveryPacketEchoes", - "imageSend_preparingPreview", - "imageSend_tryAnother", - "imageSend_versionsHint", - "imageSend_versionLabel", - "imageSend_versionPackets" - ], - - "pt": [ - "receivedImage_packetEchoes", - "receivedImage_recoveryPacketEchoes", - "imageSend_preparingPreview", - "imageSend_tryAnother", - "imageSend_versionsHint", - "imageSend_versionLabel", - "imageSend_versionPackets" - ], - - "pt_PT": [ - "receivedImage_packetEchoes", - "receivedImage_recoveryPacketEchoes", - "imageSend_preparingPreview", - "imageSend_tryAnother", - "imageSend_versionsHint", - "imageSend_versionLabel", - "imageSend_versionPackets" - ], - - "ru": [ - "receivedImage_packetEchoes", - "receivedImage_recoveryPacketEchoes", - "imageSend_preparingPreview", - "imageSend_tryAnother", - "imageSend_versionsHint", - "imageSend_versionLabel", - "imageSend_versionPackets" - ], - - "sk": [ - "receivedImage_packetEchoes", - "receivedImage_recoveryPacketEchoes", - "imageSend_preparingPreview", - "imageSend_tryAnother", - "imageSend_versionsHint", - "imageSend_versionLabel", - "imageSend_versionPackets" - ], - - "sl": [ - "receivedImage_packetEchoes", - "receivedImage_recoveryPacketEchoes", - "imageSend_preparingPreview", - "imageSend_tryAnother", - "imageSend_versionsHint", - "imageSend_versionLabel", - "imageSend_versionPackets" - ], - - "sv": [ - "receivedImage_packetEchoes", - "receivedImage_recoveryPacketEchoes", - "imageSend_preparingPreview", - "imageSend_tryAnother", - "imageSend_versionsHint", - "imageSend_versionLabel", - "imageSend_versionPackets" - ], - - "uk": [ - "receivedImage_packetEchoes", - "receivedImage_recoveryPacketEchoes", - "imageSend_preparingPreview", - "imageSend_tryAnother", - "imageSend_versionsHint", - "imageSend_versionLabel", - "imageSend_versionPackets" - ], - - "zh": [ + "settings_exportBookmarksNoBookmarks", "receivedImage_packetEchoes", "receivedImage_recoveryPacketEchoes", "imageSend_preparingPreview",