From b6c94efd5b6df9195a3055ada0b0cc9dd7b0a174 Mon Sep 17 00:00:00 2001 From: Strycher Date: Mon, 27 Jul 2026 23:52:33 -0400 Subject: [PATCH] chore(#427): localize the log-share strings (App + BLE screens) Route LogExport's Share tooltip, share subject, and file-logging-unavailable snackbar through context.l10n instead of hardcoded English. Adds four keys to app_en.arb (debugLog_shareLog, debugLog_openLogsFolder, debugLog_shareSubject, debugLog_fileLoggingUnavailable) and regenerates all locales (English fallback until translated). Resolves the deferred Gemini finding from #393. Co-Authored-By: Claude Opus 4.8 --- lib/l10n/app_en.arb | 4 ++++ lib/l10n/app_localizations.dart | 24 ++++++++++++++++++++++++ lib/l10n/app_localizations_bg.dart | 13 +++++++++++++ lib/l10n/app_localizations_de.dart | 13 +++++++++++++ lib/l10n/app_localizations_en.dart | 13 +++++++++++++ lib/l10n/app_localizations_es.dart | 13 +++++++++++++ lib/l10n/app_localizations_fr.dart | 13 +++++++++++++ lib/l10n/app_localizations_hu.dart | 13 +++++++++++++ lib/l10n/app_localizations_it.dart | 13 +++++++++++++ lib/l10n/app_localizations_ja.dart | 13 +++++++++++++ lib/l10n/app_localizations_ko.dart | 13 +++++++++++++ lib/l10n/app_localizations_nl.dart | 13 +++++++++++++ lib/l10n/app_localizations_pl.dart | 13 +++++++++++++ lib/l10n/app_localizations_pt.dart | 13 +++++++++++++ lib/l10n/app_localizations_ru.dart | 13 +++++++++++++ lib/l10n/app_localizations_sk.dart | 13 +++++++++++++ lib/l10n/app_localizations_sl.dart | 13 +++++++++++++ lib/l10n/app_localizations_sv.dart | 13 +++++++++++++ lib/l10n/app_localizations_uk.dart | 13 +++++++++++++ lib/l10n/app_localizations_zh.dart | 13 +++++++++++++ lib/screens/app_debug_log_screen.dart | 2 +- lib/screens/ble_debug_log_screen.dart | 2 +- lib/utils/log_export.dart | 18 ++++++++---------- 23 files changed, 272 insertions(+), 12 deletions(-) diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb index d24df1c4..0f3346f1 100644 --- a/lib/l10n/app_en.arb +++ b/lib/l10n/app_en.arb @@ -756,6 +756,10 @@ "debugLog_bleTitle": "BLE Debug Log", "debugLog_copyLog": "Copy log", "debugLog_clearLog": "Clear log", + "debugLog_shareLog": "Share logs", + "debugLog_openLogsFolder": "Open logs folder", + "debugLog_shareSubject": "Offband Meshcore logs", + "debugLog_fileLoggingUnavailable": "File logging is unavailable on this platform", "debugLog_copied": "Debug log copied", "debugLog_bleCopied": "BLE log copied", "debugLog_noEntries": "No debug logs yet", diff --git a/lib/l10n/app_localizations.dart b/lib/l10n/app_localizations.dart index d315a487..a68a1d6e 100644 --- a/lib/l10n/app_localizations.dart +++ b/lib/l10n/app_localizations.dart @@ -2800,6 +2800,30 @@ abstract class AppLocalizations { /// **'Clear log'** String get debugLog_clearLog; + /// No description provided for @debugLog_shareLog. + /// + /// In en, this message translates to: + /// **'Share logs'** + String get debugLog_shareLog; + + /// No description provided for @debugLog_openLogsFolder. + /// + /// In en, this message translates to: + /// **'Open logs folder'** + String get debugLog_openLogsFolder; + + /// No description provided for @debugLog_shareSubject. + /// + /// In en, this message translates to: + /// **'Offband Meshcore logs'** + String get debugLog_shareSubject; + + /// No description provided for @debugLog_fileLoggingUnavailable. + /// + /// In en, this message translates to: + /// **'File logging is unavailable on this platform'** + String get debugLog_fileLoggingUnavailable; + /// No description provided for @debugLog_copied. /// /// In en, this message translates to: diff --git a/lib/l10n/app_localizations_bg.dart b/lib/l10n/app_localizations_bg.dart index 06e8c288..31d8b5e1 100644 --- a/lib/l10n/app_localizations_bg.dart +++ b/lib/l10n/app_localizations_bg.dart @@ -1520,6 +1520,19 @@ class AppLocalizationsBg extends AppLocalizations { @override String get debugLog_clearLog => 'Изчисти логовете'; + @override + String get debugLog_shareLog => 'Share logs'; + + @override + String get debugLog_openLogsFolder => 'Open logs folder'; + + @override + String get debugLog_shareSubject => 'Offband Meshcore logs'; + + @override + String get debugLog_fileLoggingUnavailable => + 'File logging is unavailable on this platform'; + @override String get debugLog_copied => 'Копирано лого за отстраняване на грешки'; diff --git a/lib/l10n/app_localizations_de.dart b/lib/l10n/app_localizations_de.dart index e314e80a..b986164a 100644 --- a/lib/l10n/app_localizations_de.dart +++ b/lib/l10n/app_localizations_de.dart @@ -1517,6 +1517,19 @@ class AppLocalizationsDe extends AppLocalizations { @override String get debugLog_clearLog => 'Protokoll löschen'; + @override + String get debugLog_shareLog => 'Share logs'; + + @override + String get debugLog_openLogsFolder => 'Open logs folder'; + + @override + String get debugLog_shareSubject => 'Offband Meshcore logs'; + + @override + String get debugLog_fileLoggingUnavailable => + 'File logging is unavailable on this platform'; + @override String get debugLog_copied => 'Debug-Protokoll kopiert'; diff --git a/lib/l10n/app_localizations_en.dart b/lib/l10n/app_localizations_en.dart index 9585df4c..4abac000 100644 --- a/lib/l10n/app_localizations_en.dart +++ b/lib/l10n/app_localizations_en.dart @@ -1489,6 +1489,19 @@ class AppLocalizationsEn extends AppLocalizations { @override String get debugLog_clearLog => 'Clear log'; + @override + String get debugLog_shareLog => 'Share logs'; + + @override + String get debugLog_openLogsFolder => 'Open logs folder'; + + @override + String get debugLog_shareSubject => 'Offband Meshcore logs'; + + @override + String get debugLog_fileLoggingUnavailable => + 'File logging is unavailable on this platform'; + @override String get debugLog_copied => 'Debug log copied'; diff --git a/lib/l10n/app_localizations_es.dart b/lib/l10n/app_localizations_es.dart index f4226970..55f84c71 100644 --- a/lib/l10n/app_localizations_es.dart +++ b/lib/l10n/app_localizations_es.dart @@ -1516,6 +1516,19 @@ class AppLocalizationsEs extends AppLocalizations { @override String get debugLog_clearLog => 'Borrar registro'; + @override + String get debugLog_shareLog => 'Share logs'; + + @override + String get debugLog_openLogsFolder => 'Open logs folder'; + + @override + String get debugLog_shareSubject => 'Offband Meshcore logs'; + + @override + String get debugLog_fileLoggingUnavailable => + 'File logging is unavailable on this platform'; + @override String get debugLog_copied => 'Registro de depuración copiado'; diff --git a/lib/l10n/app_localizations_fr.dart b/lib/l10n/app_localizations_fr.dart index 2bffe9c1..73622c9c 100644 --- a/lib/l10n/app_localizations_fr.dart +++ b/lib/l10n/app_localizations_fr.dart @@ -1521,6 +1521,19 @@ class AppLocalizationsFr extends AppLocalizations { @override String get debugLog_clearLog => 'Effacer le journal'; + @override + String get debugLog_shareLog => 'Share logs'; + + @override + String get debugLog_openLogsFolder => 'Open logs folder'; + + @override + String get debugLog_shareSubject => 'Offband Meshcore logs'; + + @override + String get debugLog_fileLoggingUnavailable => + 'File logging is unavailable on this platform'; + @override String get debugLog_copied => 'Journal de débogage copié'; diff --git a/lib/l10n/app_localizations_hu.dart b/lib/l10n/app_localizations_hu.dart index a5e3ac61..85510315 100644 --- a/lib/l10n/app_localizations_hu.dart +++ b/lib/l10n/app_localizations_hu.dart @@ -1524,6 +1524,19 @@ class AppLocalizationsHu extends AppLocalizations { @override String get debugLog_clearLog => 'Jelzett napló'; + @override + String get debugLog_shareLog => 'Share logs'; + + @override + String get debugLog_openLogsFolder => 'Open logs folder'; + + @override + String get debugLog_shareSubject => 'Offband Meshcore logs'; + + @override + String get debugLog_fileLoggingUnavailable => + 'File logging is unavailable on this platform'; + @override String get debugLog_copied => 'Hibajelentő napló másolva'; diff --git a/lib/l10n/app_localizations_it.dart b/lib/l10n/app_localizations_it.dart index e1d6be83..164d1493 100644 --- a/lib/l10n/app_localizations_it.dart +++ b/lib/l10n/app_localizations_it.dart @@ -1518,6 +1518,19 @@ class AppLocalizationsIt extends AppLocalizations { @override String get debugLog_clearLog => 'Cancella log'; + @override + String get debugLog_shareLog => 'Share logs'; + + @override + String get debugLog_openLogsFolder => 'Open logs folder'; + + @override + String get debugLog_shareSubject => 'Offband Meshcore logs'; + + @override + String get debugLog_fileLoggingUnavailable => + 'File logging is unavailable on this platform'; + @override String get debugLog_copied => 'Log di debug copiato'; diff --git a/lib/l10n/app_localizations_ja.dart b/lib/l10n/app_localizations_ja.dart index a5ce4210..e972d364 100644 --- a/lib/l10n/app_localizations_ja.dart +++ b/lib/l10n/app_localizations_ja.dart @@ -1455,6 +1455,19 @@ class AppLocalizationsJa extends AppLocalizations { @override String get debugLog_clearLog => '詳細なログ'; + @override + String get debugLog_shareLog => 'Share logs'; + + @override + String get debugLog_openLogsFolder => 'Open logs folder'; + + @override + String get debugLog_shareSubject => 'Offband Meshcore logs'; + + @override + String get debugLog_fileLoggingUnavailable => + 'File logging is unavailable on this platform'; + @override String get debugLog_copied => 'デバッグログをコピー'; diff --git a/lib/l10n/app_localizations_ko.dart b/lib/l10n/app_localizations_ko.dart index 10f147b5..dfcbd112 100644 --- a/lib/l10n/app_localizations_ko.dart +++ b/lib/l10n/app_localizations_ko.dart @@ -1450,6 +1450,19 @@ class AppLocalizationsKo extends AppLocalizations { @override String get debugLog_clearLog => '명확한 로그'; + @override + String get debugLog_shareLog => 'Share logs'; + + @override + String get debugLog_openLogsFolder => 'Open logs folder'; + + @override + String get debugLog_shareSubject => 'Offband Meshcore logs'; + + @override + String get debugLog_fileLoggingUnavailable => + 'File logging is unavailable on this platform'; + @override String get debugLog_copied => '디버깅 로그 복사'; diff --git a/lib/l10n/app_localizations_nl.dart b/lib/l10n/app_localizations_nl.dart index 5fa5a120..38975743 100644 --- a/lib/l10n/app_localizations_nl.dart +++ b/lib/l10n/app_localizations_nl.dart @@ -1506,6 +1506,19 @@ class AppLocalizationsNl extends AppLocalizations { @override String get debugLog_clearLog => 'Log wissen'; + @override + String get debugLog_shareLog => 'Share logs'; + + @override + String get debugLog_openLogsFolder => 'Open logs folder'; + + @override + String get debugLog_shareSubject => 'Offband Meshcore logs'; + + @override + String get debugLog_fileLoggingUnavailable => + 'File logging is unavailable on this platform'; + @override String get debugLog_copied => 'Debuglog gekopieerd'; diff --git a/lib/l10n/app_localizations_pl.dart b/lib/l10n/app_localizations_pl.dart index dd603dfa..ffec4069 100644 --- a/lib/l10n/app_localizations_pl.dart +++ b/lib/l10n/app_localizations_pl.dart @@ -1528,6 +1528,19 @@ class AppLocalizationsPl extends AppLocalizations { @override String get debugLog_clearLog => 'Wyczyść dziennik'; + @override + String get debugLog_shareLog => 'Share logs'; + + @override + String get debugLog_openLogsFolder => 'Open logs folder'; + + @override + String get debugLog_shareSubject => 'Offband Meshcore logs'; + + @override + String get debugLog_fileLoggingUnavailable => + 'File logging is unavailable on this platform'; + @override String get debugLog_copied => 'Skopiowano dziennik debugowania'; diff --git a/lib/l10n/app_localizations_pt.dart b/lib/l10n/app_localizations_pt.dart index 76dcdf7e..bd9ca9e0 100644 --- a/lib/l10n/app_localizations_pt.dart +++ b/lib/l10n/app_localizations_pt.dart @@ -1515,6 +1515,19 @@ class AppLocalizationsPt extends AppLocalizations { @override String get debugLog_clearLog => 'Limpar log'; + @override + String get debugLog_shareLog => 'Share logs'; + + @override + String get debugLog_openLogsFolder => 'Open logs folder'; + + @override + String get debugLog_shareSubject => 'Offband Meshcore logs'; + + @override + String get debugLog_fileLoggingUnavailable => + 'File logging is unavailable on this platform'; + @override String get debugLog_copied => 'Log de depuração copiado'; diff --git a/lib/l10n/app_localizations_ru.dart b/lib/l10n/app_localizations_ru.dart index 66125224..f488fd8b 100644 --- a/lib/l10n/app_localizations_ru.dart +++ b/lib/l10n/app_localizations_ru.dart @@ -1516,6 +1516,19 @@ class AppLocalizationsRu extends AppLocalizations { @override String get debugLog_clearLog => 'Очистить журнал'; + @override + String get debugLog_shareLog => 'Share logs'; + + @override + String get debugLog_openLogsFolder => 'Open logs folder'; + + @override + String get debugLog_shareSubject => 'Offband Meshcore logs'; + + @override + String get debugLog_fileLoggingUnavailable => + 'File logging is unavailable on this platform'; + @override String get debugLog_copied => 'Журнал отладки скопирован'; diff --git a/lib/l10n/app_localizations_sk.dart b/lib/l10n/app_localizations_sk.dart index b9a06304..2558f439 100644 --- a/lib/l10n/app_localizations_sk.dart +++ b/lib/l10n/app_localizations_sk.dart @@ -1506,6 +1506,19 @@ class AppLocalizationsSk extends AppLocalizations { @override String get debugLog_clearLog => 'Vymažať záznam'; + @override + String get debugLog_shareLog => 'Share logs'; + + @override + String get debugLog_openLogsFolder => 'Open logs folder'; + + @override + String get debugLog_shareSubject => 'Offband Meshcore logs'; + + @override + String get debugLog_fileLoggingUnavailable => + 'File logging is unavailable on this platform'; + @override String get debugLog_copied => 'Záznam ladenia skopírovaný'; diff --git a/lib/l10n/app_localizations_sl.dart b/lib/l10n/app_localizations_sl.dart index 93690a56..9c93f2e7 100644 --- a/lib/l10n/app_localizations_sl.dart +++ b/lib/l10n/app_localizations_sl.dart @@ -1504,6 +1504,19 @@ class AppLocalizationsSl extends AppLocalizations { @override String get debugLog_clearLog => 'Briši log'; + @override + String get debugLog_shareLog => 'Share logs'; + + @override + String get debugLog_openLogsFolder => 'Open logs folder'; + + @override + String get debugLog_shareSubject => 'Offband Meshcore logs'; + + @override + String get debugLog_fileLoggingUnavailable => + 'File logging is unavailable on this platform'; + @override String get debugLog_copied => 'Beležka kopirana.'; diff --git a/lib/l10n/app_localizations_sv.dart b/lib/l10n/app_localizations_sv.dart index 0bb2b720..33bf3457 100644 --- a/lib/l10n/app_localizations_sv.dart +++ b/lib/l10n/app_localizations_sv.dart @@ -1498,6 +1498,19 @@ class AppLocalizationsSv extends AppLocalizations { @override String get debugLog_clearLog => 'Rensa logg'; + @override + String get debugLog_shareLog => 'Share logs'; + + @override + String get debugLog_openLogsFolder => 'Open logs folder'; + + @override + String get debugLog_shareSubject => 'Offband Meshcore logs'; + + @override + String get debugLog_fileLoggingUnavailable => + 'File logging is unavailable on this platform'; + @override String get debugLog_copied => 'Felsökningslogg kopierad'; diff --git a/lib/l10n/app_localizations_uk.dart b/lib/l10n/app_localizations_uk.dart index 1e5c405f..a4f45b1d 100644 --- a/lib/l10n/app_localizations_uk.dart +++ b/lib/l10n/app_localizations_uk.dart @@ -1510,6 +1510,19 @@ class AppLocalizationsUk extends AppLocalizations { @override String get debugLog_clearLog => 'Очистити журнал'; + @override + String get debugLog_shareLog => 'Share logs'; + + @override + String get debugLog_openLogsFolder => 'Open logs folder'; + + @override + String get debugLog_shareSubject => 'Offband Meshcore logs'; + + @override + String get debugLog_fileLoggingUnavailable => + 'File logging is unavailable on this platform'; + @override String get debugLog_copied => 'Журнал налагодження скопійовано'; diff --git a/lib/l10n/app_localizations_zh.dart b/lib/l10n/app_localizations_zh.dart index af2ed6db..2f0bbd19 100644 --- a/lib/l10n/app_localizations_zh.dart +++ b/lib/l10n/app_localizations_zh.dart @@ -1436,6 +1436,19 @@ class AppLocalizationsZh extends AppLocalizations { @override String get debugLog_clearLog => '清除日志'; + @override + String get debugLog_shareLog => 'Share logs'; + + @override + String get debugLog_openLogsFolder => 'Open logs folder'; + + @override + String get debugLog_shareSubject => 'Offband Meshcore logs'; + + @override + String get debugLog_fileLoggingUnavailable => + 'File logging is unavailable on this platform'; + @override String get debugLog_copied => '调试日志已复制'; diff --git a/lib/screens/app_debug_log_screen.dart b/lib/screens/app_debug_log_screen.dart index 74b9a7bd..a79df510 100644 --- a/lib/screens/app_debug_log_screen.dart +++ b/lib/screens/app_debug_log_screen.dart @@ -24,7 +24,7 @@ class AppDebugLogScreen extends StatelessWidget { centerTitle: true, actions: [ IconButton( - tooltip: LogExport.tooltip, + tooltip: LogExport.tooltip(context), icon: Icon(LogExport.icon), onPressed: () => LogExport.shareLogs(context), ), diff --git a/lib/screens/ble_debug_log_screen.dart b/lib/screens/ble_debug_log_screen.dart index 85169d4f..7964a67c 100644 --- a/lib/screens/ble_debug_log_screen.dart +++ b/lib/screens/ble_debug_log_screen.dart @@ -35,7 +35,7 @@ class _BleDebugLogScreenState extends State { title: AdaptiveAppBarTitle(context.l10n.debugLog_bleTitle), actions: [ IconButton( - tooltip: LogExport.tooltip, + tooltip: LogExport.tooltip(context), icon: Icon(LogExport.icon), onPressed: () => LogExport.shareLogs(context), ), diff --git a/lib/utils/log_export.dart b/lib/utils/log_export.dart index 317c1160..1d992ce0 100644 --- a/lib/utils/log_export.dart +++ b/lib/utils/log_export.dart @@ -3,6 +3,7 @@ import 'package:flutter/material.dart'; import 'package:share_plus/share_plus.dart'; import 'package:url_launcher/url_launcher.dart'; +import '../l10n/l10n.dart'; import '../services/file_log_service.dart'; /// Shared log export for the App-log and BLE-log screens (#393, #97). @@ -25,28 +26,25 @@ class LogExport { ? Icons.ios_share : Icons.folder_open; - static String get tooltip => _isMobile ? 'Share logs' : 'Open logs folder'; + static String tooltip(BuildContext context) => _isMobile + ? context.l10n.debugLog_shareLog + : context.l10n.debugLog_openLogsFolder; /// Flush the on-disk log and hand it to the OS share sheet (mobile), or open /// the logs folder in the file manager (desktop). Shows a snackbar if file /// logging is unavailable (e.g. web). static Future shareLogs(BuildContext context) async { final messenger = ScaffoldMessenger.of(context); + final unavailableMessage = context.l10n.debugLog_fileLoggingUnavailable; + final subject = context.l10n.debugLog_shareSubject; final file = await FileLogService.instance.flushAndGetActiveFile(); if (file == null) { - messenger.showSnackBar( - const SnackBar( - content: Text('File logging is unavailable on this platform'), - ), - ); + messenger.showSnackBar(SnackBar(content: Text(unavailableMessage))); return; } if (_isMobile) { await SharePlus.instance.share( - ShareParams( - subject: 'Offband Meshcore logs', - files: [XFile(file.path)], - ), + ShareParams(subject: subject, files: [XFile(file.path)]), ); } else { final dir = FileLogService.instance.logDir;