mirror of
https://github.com/jonasbark/swiftcontrol.git
synced 2026-12-04 20:52:23 +01:00
i18n: translate connection alerts and scan/disconnect log strings
Replaces hard-coded English strings in lib/bluetooth/connection.dart with AppLocalizations accessors and adds the new keys to all six ARB locales (en, de, es, fr, it, pl). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -212,7 +212,7 @@ class Connection {
|
||||
return;
|
||||
}
|
||||
isScanning.value = true;
|
||||
_actionStreams.add(LogNotification('Scanning for devices...'));
|
||||
_actionStreams.add(LogNotification(AppLocalizations.current.scanningForDevicesShort));
|
||||
|
||||
if (screenshotMode) {
|
||||
return;
|
||||
@@ -327,7 +327,7 @@ class Connection {
|
||||
_actionStreams.add(
|
||||
AlertNotification(
|
||||
LogLevel.LOGLEVEL_ERROR,
|
||||
'Error starting MyWhoosh "Link" server. Please make sure the "MyWhoosh Link" app is not already running on this device.',
|
||||
AppLocalizations.current.errorStartingMyWhooshLink,
|
||||
),
|
||||
);
|
||||
});
|
||||
@@ -376,7 +376,9 @@ class Connection {
|
||||
|
||||
final willConnect = device is! ProxyDevice || device.shouldAutoConnect;
|
||||
if (willConnect) {
|
||||
_actionStreams.add(AlertNotification(LogLevel.LOGLEVEL_INFO, 'Connecting to: ${device.toString()}'));
|
||||
_actionStreams.add(
|
||||
AlertNotification(LogLevel.LOGLEVEL_INFO, AppLocalizations.current.connectingToDevice(device.toString())),
|
||||
);
|
||||
}
|
||||
_connect(device)
|
||||
.then((_) {
|
||||
@@ -384,7 +386,10 @@ class Connection {
|
||||
|
||||
if (willConnect) {
|
||||
_actionStreams.add(
|
||||
AlertNotification(LogLevel.LOGLEVEL_INFO, 'Connection finished: ${device.toString()}'),
|
||||
AlertNotification(
|
||||
LogLevel.LOGLEVEL_INFO,
|
||||
AppLocalizations.current.connectionSucceeded(device.toString()),
|
||||
),
|
||||
);
|
||||
}
|
||||
if (_connectionQueue.isNotEmpty) {
|
||||
@@ -396,11 +401,17 @@ class Connection {
|
||||
_handlingConnectionQueue = false;
|
||||
if (e is TimeoutException) {
|
||||
_actionStreams.add(
|
||||
AlertNotification(LogLevel.LOGLEVEL_WARNING, 'Unable to connect to ${device.toString()}: Timeout'),
|
||||
AlertNotification(
|
||||
LogLevel.LOGLEVEL_WARNING,
|
||||
AppLocalizations.current.unableToConnectToDeviceTimeout(device.toString()),
|
||||
),
|
||||
);
|
||||
} else {
|
||||
_actionStreams.add(
|
||||
AlertNotification(LogLevel.LOGLEVEL_ERROR, 'Connection failed: ${device.toString()} - $e'),
|
||||
AlertNotification(
|
||||
LogLevel.LOGLEVEL_ERROR,
|
||||
AppLocalizations.current.connectionFailed(device.toString(), e.toString()),
|
||||
),
|
||||
);
|
||||
}
|
||||
if (_connectionQueue.isNotEmpty) {
|
||||
@@ -543,7 +554,7 @@ class Connection {
|
||||
|
||||
Future<void> disconnectAll() async {
|
||||
_cancelAllInactivityTimers();
|
||||
_actionStreams.add(LogNotification('Disconnecting all devices'));
|
||||
_actionStreams.add(LogNotification(AppLocalizations.current.disconnectingAllDevices));
|
||||
for (var device in bluetoothDevices) {
|
||||
_streamSubscriptions[device]?.cancel();
|
||||
_streamSubscriptions.remove(device);
|
||||
|
||||
@@ -823,5 +823,26 @@
|
||||
"disconnectLabel": {"type": "String"}
|
||||
}
|
||||
},
|
||||
"overlayFieldControls": "Schalt-/Watt-Tasten"
|
||||
"overlayFieldControls": "Schalt-/Watt-Tasten",
|
||||
"connectingToDevice": "Verbinde mit: {device}",
|
||||
"@connectingToDevice": {
|
||||
"placeholders": {"device": {"type": "String"}}
|
||||
},
|
||||
"connectionSucceeded": "Verbindung erfolgreich: {device}",
|
||||
"@connectionSucceeded": {
|
||||
"placeholders": {"device": {"type": "String"}}
|
||||
},
|
||||
"connectionFailed": "Verbindung fehlgeschlagen: {device} – {error}",
|
||||
"@connectionFailed": {
|
||||
"placeholders": {
|
||||
"device": {"type": "String"},
|
||||
"error": {"type": "String"}
|
||||
}
|
||||
},
|
||||
"unableToConnectToDeviceTimeout": "Verbindung zu {device} nicht möglich: Zeitüberschreitung",
|
||||
"@unableToConnectToDeviceTimeout": {
|
||||
"placeholders": {"device": {"type": "String"}}
|
||||
},
|
||||
"scanningForDevicesShort": "Suche nach Geräten…",
|
||||
"disconnectingAllDevices": "Trenne alle Geräte"
|
||||
}
|
||||
|
||||
@@ -980,5 +980,26 @@
|
||||
"appName": {"type": "String"},
|
||||
"disconnectLabel": {"type": "String"}
|
||||
}
|
||||
}
|
||||
},
|
||||
"connectingToDevice": "Connecting to: {device}",
|
||||
"@connectingToDevice": {
|
||||
"placeholders": {"device": {"type": "String"}}
|
||||
},
|
||||
"connectionSucceeded": "Connection succeeded: {device}",
|
||||
"@connectionSucceeded": {
|
||||
"placeholders": {"device": {"type": "String"}}
|
||||
},
|
||||
"connectionFailed": "Connection failed: {device} - {error}",
|
||||
"@connectionFailed": {
|
||||
"placeholders": {
|
||||
"device": {"type": "String"},
|
||||
"error": {"type": "String"}
|
||||
}
|
||||
},
|
||||
"unableToConnectToDeviceTimeout": "Unable to connect to {device}: Timeout",
|
||||
"@unableToConnectToDeviceTimeout": {
|
||||
"placeholders": {"device": {"type": "String"}}
|
||||
},
|
||||
"scanningForDevicesShort": "Scanning for devices...",
|
||||
"disconnectingAllDevices": "Disconnecting all devices"
|
||||
}
|
||||
|
||||
@@ -823,5 +823,26 @@
|
||||
"disconnectLabel": {"type": "String"}
|
||||
}
|
||||
},
|
||||
"overlayFieldControls": "Botones de cambio / vatios"
|
||||
"overlayFieldControls": "Botones de cambio / vatios",
|
||||
"connectingToDevice": "Conectando a: {device}",
|
||||
"@connectingToDevice": {
|
||||
"placeholders": {"device": {"type": "String"}}
|
||||
},
|
||||
"connectionSucceeded": "Conexión exitosa: {device}",
|
||||
"@connectionSucceeded": {
|
||||
"placeholders": {"device": {"type": "String"}}
|
||||
},
|
||||
"connectionFailed": "Conexión fallida: {device} - {error}",
|
||||
"@connectionFailed": {
|
||||
"placeholders": {
|
||||
"device": {"type": "String"},
|
||||
"error": {"type": "String"}
|
||||
}
|
||||
},
|
||||
"unableToConnectToDeviceTimeout": "No se pudo conectar a {device}: Tiempo de espera agotado",
|
||||
"@unableToConnectToDeviceTimeout": {
|
||||
"placeholders": {"device": {"type": "String"}}
|
||||
},
|
||||
"scanningForDevicesShort": "Buscando dispositivos...",
|
||||
"disconnectingAllDevices": "Desconectando todos los dispositivos"
|
||||
}
|
||||
|
||||
@@ -824,5 +824,26 @@
|
||||
"disconnectLabel": {"type": "String"}
|
||||
}
|
||||
},
|
||||
"overlayFieldControls": "Boutons de vitesses / watts"
|
||||
"overlayFieldControls": "Boutons de vitesses / watts",
|
||||
"connectingToDevice": "Connexion à : {device}",
|
||||
"@connectingToDevice": {
|
||||
"placeholders": {"device": {"type": "String"}}
|
||||
},
|
||||
"connectionSucceeded": "Connexion réussie : {device}",
|
||||
"@connectionSucceeded": {
|
||||
"placeholders": {"device": {"type": "String"}}
|
||||
},
|
||||
"connectionFailed": "Échec de la connexion : {device} - {error}",
|
||||
"@connectionFailed": {
|
||||
"placeholders": {
|
||||
"device": {"type": "String"},
|
||||
"error": {"type": "String"}
|
||||
}
|
||||
},
|
||||
"unableToConnectToDeviceTimeout": "Impossible de se connecter à {device} : délai dépassé",
|
||||
"@unableToConnectToDeviceTimeout": {
|
||||
"placeholders": {"device": {"type": "String"}}
|
||||
},
|
||||
"scanningForDevicesShort": "Recherche d'appareils…",
|
||||
"disconnectingAllDevices": "Déconnexion de tous les appareils"
|
||||
}
|
||||
|
||||
@@ -823,5 +823,26 @@
|
||||
"disconnectLabel": {"type": "String"}
|
||||
}
|
||||
},
|
||||
"overlayFieldControls": "Pulsanti cambio / watt"
|
||||
"overlayFieldControls": "Pulsanti cambio / watt",
|
||||
"connectingToDevice": "Connessione a: {device}",
|
||||
"@connectingToDevice": {
|
||||
"placeholders": {"device": {"type": "String"}}
|
||||
},
|
||||
"connectionSucceeded": "Connessione riuscita: {device}",
|
||||
"@connectionSucceeded": {
|
||||
"placeholders": {"device": {"type": "String"}}
|
||||
},
|
||||
"connectionFailed": "Connessione fallita: {device} - {error}",
|
||||
"@connectionFailed": {
|
||||
"placeholders": {
|
||||
"device": {"type": "String"},
|
||||
"error": {"type": "String"}
|
||||
}
|
||||
},
|
||||
"unableToConnectToDeviceTimeout": "Impossibile connettersi a {device}: timeout",
|
||||
"@unableToConnectToDeviceTimeout": {
|
||||
"placeholders": {"device": {"type": "String"}}
|
||||
},
|
||||
"scanningForDevicesShort": "Ricerca dispositivi…",
|
||||
"disconnectingAllDevices": "Disconnessione di tutti i dispositivi"
|
||||
}
|
||||
|
||||
@@ -823,5 +823,26 @@
|
||||
"disconnectLabel": {"type": "String"}
|
||||
}
|
||||
},
|
||||
"overlayFieldControls": "Przyciski biegów / mocy"
|
||||
"overlayFieldControls": "Przyciski biegów / mocy",
|
||||
"connectingToDevice": "Łączenie z: {device}",
|
||||
"@connectingToDevice": {
|
||||
"placeholders": {"device": {"type": "String"}}
|
||||
},
|
||||
"connectionSucceeded": "Połączenie udane: {device}",
|
||||
"@connectionSucceeded": {
|
||||
"placeholders": {"device": {"type": "String"}}
|
||||
},
|
||||
"connectionFailed": "Połączenie nie powiodło się: {device} - {error}",
|
||||
"@connectionFailed": {
|
||||
"placeholders": {
|
||||
"device": {"type": "String"},
|
||||
"error": {"type": "String"}
|
||||
}
|
||||
},
|
||||
"unableToConnectToDeviceTimeout": "Nie można połączyć z {device}: Przekroczono limit czasu",
|
||||
"@unableToConnectToDeviceTimeout": {
|
||||
"placeholders": {"device": {"type": "String"}}
|
||||
},
|
||||
"scanningForDevicesShort": "Skanowanie urządzeń...",
|
||||
"disconnectingAllDevices": "Rozłączanie wszystkich urządzeń"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user