translate forgotpassword 100%
This commit is contained in:
@@ -90,5 +90,6 @@
|
|||||||
"updated": "Updated",
|
"updated": "Updated",
|
||||||
"settings_updated": "Settings updated",
|
"settings_updated": "Settings updated",
|
||||||
"define_kilometer": "Define Kilometer",
|
"define_kilometer": "Define Kilometer",
|
||||||
"settings": "Settings"
|
"settings": "Settings",
|
||||||
|
"email_sent": "Email has been sent"
|
||||||
}
|
}
|
@@ -90,6 +90,7 @@
|
|||||||
"updated": "Mis à jour",
|
"updated": "Mis à jour",
|
||||||
"settings_updated": "Paramètre mis à jour",
|
"settings_updated": "Paramètre mis à jour",
|
||||||
"define_kilometer": "Definir un kilomètre",
|
"define_kilometer": "Definir un kilomètre",
|
||||||
"settings": "Paramètres"
|
"settings": "Paramètres",
|
||||||
|
"email_sent": "Email a été envoyé"
|
||||||
|
|
||||||
}
|
}
|
@@ -11,6 +11,11 @@ import '../classes/alert.dart';
|
|||||||
|
|
||||||
import '../variable/globals.dart' as globals;
|
import '../variable/globals.dart' as globals;
|
||||||
|
|
||||||
|
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'; //
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
runApp(MyApp());
|
runApp(MyApp());
|
||||||
}
|
}
|
||||||
@@ -74,22 +79,32 @@ class _PasswordForgotState extends State<PasswordForgot> with ShowAlertDialog {
|
|||||||
}));
|
}));
|
||||||
print(responsePost.statusCode);
|
print(responsePost.statusCode);
|
||||||
if (responsePost.statusCode == 200) {
|
if (responsePost.statusCode == 200) {
|
||||||
showAlertDialog(context, "Creation", "Un email a été envoyé à ${email}");
|
String message =
|
||||||
|
AppLocalizations.of(context)?.email_sent ?? "Email has been sent";
|
||||||
|
showAlertDialog(
|
||||||
|
context,
|
||||||
|
AppLocalizations.of(context)?.create ?? "Creation",
|
||||||
|
"${message} : ${email}");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
final errorMessages = {
|
final messages = {
|
||||||
400: "Requête mal construite",
|
400: AppLocalizations.of(context)?.request_error ??
|
||||||
406: "Mot de passe incorrect",
|
"Poorly constructed query",
|
||||||
404: "Utilisateur inconnu",
|
406: AppLocalizations.of(context)?.incorrect_password ??
|
||||||
403: "Utilisateur désactivé",
|
"Incorrect password",
|
||||||
410: "Token invalide",
|
404: AppLocalizations.of(context)?.unknown_user ?? "Unknown user",
|
||||||
500: "Problème interne du serveur",
|
403: AppLocalizations.of(context)?.disabled_user ?? "Disabled user",
|
||||||
|
410: AppLocalizations.of(context)?.invalid_token ?? "Invalid token",
|
||||||
|
500: AppLocalizations.of(context)?.internal_error_server ??
|
||||||
|
"Internal error server"
|
||||||
};
|
};
|
||||||
|
|
||||||
final text = errorMessages[responsePost.statusCode] ??
|
final text = messages[responsePost.statusCode] ??
|
||||||
"Problème d'authentification inconnu";
|
AppLocalizations.of(context)?.unknown_error_auth ??
|
||||||
showAlertDialog(context, "Erreur serveur", text);
|
"Unknown error auth";
|
||||||
|
showAlertDialog(
|
||||||
|
context, AppLocalizations.of(context)?.error ?? "Error", text);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
Reference in New Issue
Block a user