diff --git a/covas_mobile/lib/l10n/app_en.arb b/covas_mobile/lib/l10n/app_en.arb index b6090d4..e929000 100644 --- a/covas_mobile/lib/l10n/app_en.arb +++ b/covas_mobile/lib/l10n/app_en.arb @@ -85,5 +85,10 @@ "describe_event": "Describe event", "add": "Add", "update_profile": "Update profile", -"different_password_error": "Different password" +"different_password_error": "Different password", +"update": "Update", +"updated": "Updated", +"settings_updated": "Settings updated", +"define_kilometer": "Define Kilometer", +"settings": "Settings" } \ No newline at end of file diff --git a/covas_mobile/lib/l10n/app_fr.arb b/covas_mobile/lib/l10n/app_fr.arb index 2b02d0f..f5133bc 100644 --- a/covas_mobile/lib/l10n/app_fr.arb +++ b/covas_mobile/lib/l10n/app_fr.arb @@ -85,7 +85,11 @@ "describe_event": "Décrire l'évènement", "add": "Ajouter", "update_profile": "Modifier le profil", -"different_password_error": "Mot de passe différent" - +"different_password_error": "Mot de passe différent", +"update": "Mettre à jour", +"updated": "Mis à jour", +"settings_updated": "Paramètre mis à jour", +"define_kilometer": "Definir un kilomètre", +"settings": "Paramètres" } \ No newline at end of file diff --git a/covas_mobile/lib/pages/EditSettings.dart b/covas_mobile/lib/pages/EditSettings.dart index 0be4c14..c6e36f9 100644 --- a/covas_mobile/lib/pages/EditSettings.dart +++ b/covas_mobile/lib/pages/EditSettings.dart @@ -14,6 +14,11 @@ import '../classes/ad_helper.dart'; import 'package:google_mobile_ads/google_mobile_ads.dart'; import '../classes/auth_service.dart'; +import 'package:flutter_localizations/flutter_localizations.dart'; +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:provider/provider.dart'; +import '../locale_provider.dart'; // Créé + void main() async { WidgetsFlutterBinding.ensureInitialized(); await MobileAds.instance.initialize(); @@ -56,7 +61,10 @@ class _EditProfileState extends State SharedPreferences prefs = await SharedPreferences.getInstance(); if (kilometer != null) { prefs.setDouble("kilometer", kilometer?.toDouble() ?? 50); - showAlertDialog(context, "Update", "Mise à jour des paramètres"); + showAlertDialog( + context, + AppLocalizations.of(context)?.updated ?? "Updated", + AppLocalizations.of(context)?.settings_updated ?? "Settings updated"); } } @@ -78,7 +86,7 @@ class _EditProfileState extends State return Scaffold( backgroundColor: Colors.white, appBar: AppBar( - title: Text("Settings"), + title: Text(AppLocalizations.of(context)?.settings ?? "Settings"), backgroundColor: Colors.blue, foregroundColor: Colors.white, ), @@ -103,7 +111,9 @@ class _EditProfileState extends State child: DropdownButtonFormField( decoration: InputDecoration( border: OutlineInputBorder(), - labelText: 'Define kilometer', + labelText: + AppLocalizations.of(context)?.define_kilometer ?? + 'Define kilometer', ), value: kilometer, // Set the initial selected value here, or leave as `null` if unselected. @@ -147,7 +157,7 @@ class _EditProfileState extends State child: TextButton( onPressed: () {}, child: Text( - 'Mettre à jour', + AppLocalizations.of(context)?.update ?? "Update", style: TextStyle(color: Colors.white, fontSize: 25), ), ),