From 479ab76fb7520e9885c3d8aa85f0dfa6edc4e1fc Mon Sep 17 00:00:00 2001 From: Valentin CZERYBA Date: Mon, 14 Jul 2025 22:53:34 +0200 Subject: [PATCH] full translate for AddProfile pages 10% --- covas_mobile/lib/l10n/app_en.arb | 6 +++++- covas_mobile/lib/l10n/app_fr.arb | 6 +++++- covas_mobile/lib/pages/AddProfile.dart | 15 +++++++++++++-- covas_mobile/lib/pages/ListItemMenu.dart | 1 - 4 files changed, 23 insertions(+), 5 deletions(-) diff --git a/covas_mobile/lib/l10n/app_en.arb b/covas_mobile/lib/l10n/app_en.arb index 937b4d8..aff4ba0 100644 --- a/covas_mobile/lib/l10n/app_en.arb +++ b/covas_mobile/lib/l10n/app_en.arb @@ -20,5 +20,9 @@ "no_events": "No events available for this location.", "start_date": "Start date", "end_date": "End date", -"failed_suggestions": "Failed to load suggestions" +"failed_suggestions": "Failed to load suggestions", +"error":"Error", +"password_different":"Must write a different password", +"create": "Creation", +"user_create": "Your user created" } \ 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 939b4f9..50b3777 100644 --- a/covas_mobile/lib/l10n/app_fr.arb +++ b/covas_mobile/lib/l10n/app_fr.arb @@ -20,5 +20,9 @@ "no_events": "Pas d'évènements dans cette localisation", "start_date": "Date de début", "end_date": "Date de fin", -"failed_suggestions": "Echec de chargement des suggestions" +"failed_suggestions": "Echec de chargement des suggestions", +"error":"Erreur", +"password_different":"Tu dois écrire un mot de passe different", +"create": "Création", +"user_create": "Votre utilisateur a été créé" } \ No newline at end of file diff --git a/covas_mobile/lib/pages/AddProfile.dart b/covas_mobile/lib/pages/AddProfile.dart index 5e7c8c0..df01d9f 100644 --- a/covas_mobile/lib/pages/AddProfile.dart +++ b/covas_mobile/lib/pages/AddProfile.dart @@ -13,6 +13,10 @@ import '../variable/globals.dart' as globals; import '../classes/ad_helper.dart'; import 'package:google_mobile_ads/google_mobile_ads.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éé plus loin void main() async { WidgetsFlutterBinding.ensureInitialized(); @@ -95,7 +99,11 @@ class _AddProfileState extends State with ShowAlertDialog { if ((password.isNotEmpty) && (confirmedPassword.isNotEmpty)) { if (password != confirmedPassword) { - showAlertDialog(context, "Erreur", "Mot de passe different"); + showAlertDialog( + context, + AppLocalizations.of(context)?.error ?? "Error", + AppLocalizations.of(context)?.password_different ?? + "Must write a different password"); return; } } @@ -117,7 +125,10 @@ class _AddProfileState extends State with ShowAlertDialog { })); print(responsePost.statusCode); if (responsePost.statusCode == 200) { - showAlertDialog(context, "Creation", "Votre utilisateur a été créé"); + showAlertDialog( + context, + AppLocalizations.of(context)?.create ?? "Creation", + AppLocalizations.of(context)?.user_create ?? "Your user created"); Navigator.pushReplacement( context, MaterialPageRoute(builder: (_) => LoginDemo())); return; diff --git a/covas_mobile/lib/pages/ListItemMenu.dart b/covas_mobile/lib/pages/ListItemMenu.dart index f20c68c..d518e9a 100644 --- a/covas_mobile/lib/pages/ListItemMenu.dart +++ b/covas_mobile/lib/pages/ListItemMenu.dart @@ -303,7 +303,6 @@ class _MyHomePageState extends State { } } catch (e) { fetchPostsByLocation(); - print("Error getting city and country: $e"); } }