From 98bc9bd837ed70fe3c4793755458fbcfaf1f7b6a Mon Sep 17 00:00:00 2001 From: Felix Kirchner Date: Tue, 1 Jul 2025 22:25:29 +0200 Subject: [PATCH] Added localization --- lib/l10n/app_de.arb | 11 ++++++- lib/l10n/app_en.arb | 11 ++++++- lib/l10n/app_localizations.dart | 48 ++++++++++++++++++++++++++++-- lib/l10n/app_localizations_de.dart | 26 +++++++++++++++- lib/l10n/app_localizations_en.dart | 26 +++++++++++++++- lib/views/settings_view.dart | 2 +- pubspec.yaml | 3 +- 7 files changed, 118 insertions(+), 9 deletions(-) diff --git a/lib/l10n/app_de.arb b/lib/l10n/app_de.arb index 3cb8c5e..26d9320 100644 --- a/lib/l10n/app_de.arb +++ b/lib/l10n/app_de.arb @@ -81,7 +81,16 @@ "import_data": "Daten importieren", "export_data": "Daten exportieren", "error": "Fehler", - "error_import": "Datei konnte nicht importiert werden", + + "import_sucess_title": "Import erfolgreich", + "import_sucess_message":"Die Spieldaten wurden erfolgreich importiert.", + "import_validation_error_title": "Validierung fehlgeschlagen", + "import_validation_error_message": "Es wurden keine Cabo-Counter Spieldaten gefunden. Bitte stellen Sie sicher, dass es sich um eine gültige Cabo-Counter Exportdatei handelt.", + "import_format_error_title": "Falsches Format", + "import_format_error_message": "Die Datei ist kein gültiges JSON-Format oder enthält ungültige Daten.", + "import_generic_error_title": "Import fehlgeschlagen", + "import_generic_error_message": "Der Import ist fehlgeschlagen.", + "error_export": "Datei konnte nicht exportiert werden", "error_found": "Fehler gefunden?", "create_issue": "Issue erstellen", diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb index f76e04a..120d8a0 100644 --- a/lib/l10n/app_en.arb +++ b/lib/l10n/app_en.arb @@ -81,7 +81,16 @@ "import_data": "Import Data", "export_data": "Export Data", "error": "Error", - "error_import": "Could not import file", + + "import_sucess_title": "Import successful", + "import_sucess_message":"The game data has been successfully imported.", + "import_validation_error_title": "Validation failed", + "import_validation_error_message": "No Cabo-Counter game data was found. Please make sure that this is a valid Cabo-Counter export file.", + "import_format_error_title": "Wrong format", + "import_format_error_message": "The file is not a valid JSON format or contains invalid data.", + "import_generic_error_title": "Import failed", + "import_generic_error_message": "The import has failed.", + "error_export": "Could not export file", "error_found": "Found a bug?", "create_issue": "Create Issue", diff --git a/lib/l10n/app_localizations.dart b/lib/l10n/app_localizations.dart index 1751ab7..84b9a42 100644 --- a/lib/l10n/app_localizations.dart +++ b/lib/l10n/app_localizations.dart @@ -452,11 +452,53 @@ abstract class AppLocalizations { /// **'Fehler'** String get error; - /// No description provided for @error_import. + /// No description provided for @import_sucess_title. /// /// In de, this message translates to: - /// **'Datei konnte nicht importiert werden'** - String get error_import; + /// **'Import erfolgreich'** + String get import_sucess_title; + + /// No description provided for @import_sucess_message. + /// + /// In de, this message translates to: + /// **'Die Spieldaten wurden erfolgreich importiert.'** + String get import_sucess_message; + + /// No description provided for @import_validation_error_title. + /// + /// In de, this message translates to: + /// **'Validierung fehlgeschlagen'** + String get import_validation_error_title; + + /// No description provided for @import_validation_error_message. + /// + /// In de, this message translates to: + /// **'Es wurden keine Cabo-Counter Spieldaten gefunden. Bitte stellen Sie sicher, dass es sich um eine gültige Cabo-Counter Exportdatei handelt.'** + String get import_validation_error_message; + + /// No description provided for @import_format_error_title. + /// + /// In de, this message translates to: + /// **'Falsches Format'** + String get import_format_error_title; + + /// No description provided for @import_format_error_message. + /// + /// In de, this message translates to: + /// **'Die Datei ist kein gültiges JSON-Format oder enthält ungültige Daten.'** + String get import_format_error_message; + + /// No description provided for @import_generic_error_title. + /// + /// In de, this message translates to: + /// **'Import fehlgeschlagen'** + String get import_generic_error_title; + + /// No description provided for @import_generic_error_message. + /// + /// In de, this message translates to: + /// **'Der Import ist fehlgeschlagen.'** + String get import_generic_error_message; /// No description provided for @error_export. /// diff --git a/lib/l10n/app_localizations_de.dart b/lib/l10n/app_localizations_de.dart index 434b5f1..e7719b1 100644 --- a/lib/l10n/app_localizations_de.dart +++ b/lib/l10n/app_localizations_de.dart @@ -195,7 +195,31 @@ class AppLocalizationsDe extends AppLocalizations { String get error => 'Fehler'; @override - String get error_import => 'Datei konnte nicht importiert werden'; + String get import_sucess_title => 'Import erfolgreich'; + + @override + String get import_sucess_message => + 'Die Spieldaten wurden erfolgreich importiert.'; + + @override + String get import_validation_error_title => 'Validierung fehlgeschlagen'; + + @override + String get import_validation_error_message => + 'Es wurden keine Cabo-Counter Spieldaten gefunden. Bitte stellen Sie sicher, dass es sich um eine gültige Cabo-Counter Exportdatei handelt.'; + + @override + String get import_format_error_title => 'Falsches Format'; + + @override + String get import_format_error_message => + 'Die Datei ist kein gültiges JSON-Format oder enthält ungültige Daten.'; + + @override + String get import_generic_error_title => 'Import fehlgeschlagen'; + + @override + String get import_generic_error_message => 'Der Import ist fehlgeschlagen.'; @override String get error_export => 'Datei konnte nicht exportiert werden'; diff --git a/lib/l10n/app_localizations_en.dart b/lib/l10n/app_localizations_en.dart index 64cdb77..9f9ff13 100644 --- a/lib/l10n/app_localizations_en.dart +++ b/lib/l10n/app_localizations_en.dart @@ -192,7 +192,31 @@ class AppLocalizationsEn extends AppLocalizations { String get error => 'Error'; @override - String get error_import => 'Could not import file'; + String get import_sucess_title => 'Import successful'; + + @override + String get import_sucess_message => + 'The game data has been successfully imported.'; + + @override + String get import_validation_error_title => 'Validation failed'; + + @override + String get import_validation_error_message => + 'No Cabo-Counter game data was found. Please make sure that this is a valid Cabo-Counter export file.'; + + @override + String get import_format_error_title => 'Wrong format'; + + @override + String get import_format_error_message => + 'The file is not a valid JSON format or contains invalid data.'; + + @override + String get import_generic_error_title => 'Import failed'; + + @override + String get import_generic_error_message => 'The import has failed.'; @override String get error_export => 'Could not export file'; diff --git a/lib/views/settings_view.dart b/lib/views/settings_view.dart index 2b185ef..0f41d21 100644 --- a/lib/views/settings_view.dart +++ b/lib/views/settings_view.dart @@ -230,7 +230,7 @@ class _SettingsViewState extends State { content: Text(content.last), actions: [ CupertinoDialogAction( - child: const Text('OK'), + child: Text(AppLocalizations.of(context).ok), onPressed: () => Navigator.pop(context), ), ], diff --git a/pubspec.yaml b/pubspec.yaml index 89087f1..e464e51 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,7 +2,7 @@ name: cabo_counter description: "Mobile app for the card game Cabo" publish_to: 'none' -version: 0.3.2+245 +version: 0.3.2+252 environment: sdk: ^3.5.4 @@ -26,6 +26,7 @@ dependencies: sdk: flutter intl: any syncfusion_flutter_charts: ^30.1.37 + analyzer_plugin: ^0.13.4 dev_dependencies: flutter_test: