translate updateevent 100%
This commit is contained in:
@@ -122,5 +122,12 @@
|
||||
"walking": "Walking",
|
||||
"cycling": "Cycling",
|
||||
"driving": "Driving",
|
||||
"get_direction": "Get Directions and Markers"
|
||||
"get_direction": "Get Directions and Markers",
|
||||
"missing_token": "Missing access token",
|
||||
"geocoding_error": "Error when geocoding",
|
||||
"no_found_place": "No found place",
|
||||
"upload_error": "Error when image uploading",
|
||||
"event_added": "Event added",
|
||||
"unknown_error": "Unknown error",
|
||||
"app_error": "Application error"
|
||||
}
|
@@ -122,5 +122,12 @@
|
||||
"walking": "Marche",
|
||||
"cycling": "Vélo",
|
||||
"driving": "Voiture",
|
||||
"get_direction": "Get Directions and Markers"
|
||||
"get_direction": "Get Directions and Markers",
|
||||
"missing_token": "Token d'accès manquant",
|
||||
"geocoding_error": "Erreur lors du geocodage",
|
||||
"no_found_place": "Lieu introuvable",
|
||||
"upload_error": "Erreur lors de l'upload d'image",
|
||||
"event_added": "Évènement ajouté",
|
||||
"unknown_error": "Erreur inconnue",
|
||||
"app_error": "Erreur d'application"
|
||||
}
|
@@ -179,8 +179,11 @@ class _UpdateeventImageState extends State<UpdateeventImage>
|
||||
var accessToken = prefs.getString("access_token") ?? "";
|
||||
|
||||
if (accessToken.isEmpty) {
|
||||
showAlertDialog(context, AppLocalizations.of(context)?.error ?? "Error",
|
||||
"Token d'accès manquant");
|
||||
showAlertDialog(
|
||||
context,
|
||||
AppLocalizations.of(context)?.error ?? "Error",
|
||||
AppLocalizations.of(context)?.missing_token ??
|
||||
"Missing access token");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -195,15 +198,18 @@ class _UpdateeventImageState extends State<UpdateeventImage>
|
||||
final searchboxResponse = await http.get(searchboxUrl);
|
||||
|
||||
if (searchboxResponse.statusCode != 200) {
|
||||
showAlertDialog(context, AppLocalizations.of(context)?.error ?? "Error",
|
||||
"Erreur lors de la géocodage avec Searchbox");
|
||||
showAlertDialog(
|
||||
context,
|
||||
AppLocalizations.of(context)?.error ?? "Error",
|
||||
AppLocalizations.of(context)?.geocoding_error ??
|
||||
"Error when geocoding");
|
||||
return;
|
||||
}
|
||||
|
||||
final searchboxData = json.decode(searchboxResponse.body);
|
||||
if (searchboxData['results'].isEmpty) {
|
||||
showAlertDialog(context, AppLocalizations.of(context)?.error ?? "Error",
|
||||
"Lieu introuvable");
|
||||
AppLocalizations.of(context)?.no_found_place ?? "No found place");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -247,8 +253,11 @@ class _UpdateeventImageState extends State<UpdateeventImage>
|
||||
await http.Response.fromStream(await imgbbRequest.send());
|
||||
|
||||
if (imgbbResponse.statusCode != 200) {
|
||||
showAlertDialog(context, AppLocalizations.of(context)?.error ?? "Error",
|
||||
"Erreur lors de l'upload d'image");
|
||||
showAlertDialog(
|
||||
context,
|
||||
AppLocalizations.of(context)?.error ?? "Error",
|
||||
AppLocalizations.of(context)?.upload_error ??
|
||||
"Error when image uploading");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -279,13 +288,15 @@ class _UpdateeventImageState extends State<UpdateeventImage>
|
||||
);
|
||||
|
||||
if (eventResponse.statusCode == 200 || eventResponse.statusCode == 201) {
|
||||
showEventDialog(context, "Événement $name ajouté");
|
||||
String event_message =
|
||||
AppLocalizations.of(context)?.event_added ?? "Event added";
|
||||
showEventDialog(context, "$event_message : $name");
|
||||
} else {
|
||||
handleHttpError(eventResponse.statusCode, context);
|
||||
}
|
||||
} catch (e) {
|
||||
showAlertDialog(context, AppLocalizations.of(context)?.error ?? "Error",
|
||||
"Erreur: ${e.toString()}");
|
||||
AppLocalizations.of(context)?.app_error ?? "Error application");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -302,8 +313,12 @@ class _UpdateeventImageState extends State<UpdateeventImage>
|
||||
500: AppLocalizations.of(context)?.internal_error_server ??
|
||||
"Internal error server"
|
||||
};
|
||||
showAlertDialog(context, AppLocalizations.of(context)?.error ?? "Error",
|
||||
messages[statusCode] ?? "Unknown error");
|
||||
showAlertDialog(
|
||||
context,
|
||||
AppLocalizations.of(context)?.error ?? "Error",
|
||||
messages[statusCode] ??
|
||||
AppLocalizations.of(context)?.unknown_error ??
|
||||
"Unknown error");
|
||||
}
|
||||
|
||||
void start() async {
|
||||
@@ -342,7 +357,9 @@ class _UpdateeventImageState extends State<UpdateeventImage>
|
||||
|
||||
final _formKey = GlobalKey<FormState>();
|
||||
String? _validateField(String? value) {
|
||||
return value!.isEmpty ? 'Champ requis' : null;
|
||||
return value!.isEmpty
|
||||
? AppLocalizations.of(context)?.required_input ?? 'Required input'
|
||||
: null;
|
||||
}
|
||||
|
||||
Future<void> searchSuggestions(String input) async {
|
||||
@@ -384,7 +401,7 @@ class _UpdateeventImageState extends State<UpdateeventImage>
|
||||
TextField(
|
||||
controller: inputGeo,
|
||||
decoration: InputDecoration(
|
||||
labelText: 'Lieu',
|
||||
labelText: AppLocalizations.of(context)?.location ?? 'Location',
|
||||
border: OutlineInputBorder(),
|
||||
suffixIcon: IconButton(
|
||||
icon: const Icon(Icons.clear),
|
||||
|
Reference in New Issue
Block a user