full translate for ItemListMenu pages 50%

This commit is contained in:
Valentin CZERYBA 2025-07-09 23:33:04 +02:00
parent e21b03d13c
commit 1646a0b6e3
3 changed files with 12 additions and 8 deletions

View File

@ -17,5 +17,8 @@
"hide_date_field": "Hide Date Fields", "hide_date_field": "Hide Date Fields",
"no_data": "No data available", "no_data": "No data available",
"search": "Search", "search": "Search",
"no_events": "No events available for this location." "no_events": "No events available for this location.",
"start_date": "Start date",
"end_date": "End date",
"failed_suggestions": "Failed to load suggestions"
} }

View File

@ -17,5 +17,8 @@
"hide_date_field": "Cacher Date Fields", "hide_date_field": "Cacher Date Fields",
"no_data": "Aucune donnée disponible", "no_data": "Aucune donnée disponible",
"search": "Recherche", "search": "Recherche",
"no_events": "No events available for this location." "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"
} }

View File

@ -354,7 +354,8 @@ class _MyHomePageState extends State<ListItemMenu> {
} }
}); });
} else { } else {
throw Exception('Failed to load suggestions'); throw Exception(AppLocalizations.of(context)?.failed_suggestions ??
'Failed to load suggestions');
} }
} }
@ -452,16 +453,13 @@ class _MyHomePageState extends State<ListItemMenu> {
"Content-Type": "application/json", "Content-Type": "application/json",
HttpHeaders.cookieHeader: "access_token=$accessToken" HttpHeaders.cookieHeader: "access_token=$accessToken"
}); });
print("status code tags : ${response.statusCode}");
if (response.statusCode == 200) { if (response.statusCode == 200) {
final data = json.decode(utf8.decode(response.bodyBytes)); final data = json.decode(utf8.decode(response.bodyBytes));
print("tags ${data}");
setState(() { setState(() {
suggestionsTags = (data as List) suggestionsTags = (data as List)
.map((feature) => {'name': feature['name']}) .map((feature) => {'name': feature['name']})
.toList(); .toList();
print("suggesttion tag : ${suggestionsTags}");
if (suggestionsTags.isNotEmpty) { if (suggestionsTags.isNotEmpty) {
showInputGeo = false; showInputGeo = false;
showInputSearch = false; showInputSearch = false;
@ -527,10 +525,10 @@ class _MyHomePageState extends State<ListItemMenu> {
Padding _buildDateField(String position) { Padding _buildDateField(String position) {
TextEditingController datePicker = startDatepicker; TextEditingController datePicker = startDatepicker;
String hintText = "Date de début"; String hintText = AppLocalizations.of(context)?.start_date ?? "Start date";
if (position == "end") { if (position == "end") {
datePicker = endDatepicker; datePicker = endDatepicker;
hintText = "Date de fin"; hintText = AppLocalizations.of(context)?.end_date ?? "End date";
} }
return Padding( return Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),