From e21b03d13c27d12219f4083cfd98689dace5aac4 Mon Sep 17 00:00:00 2001 From: Valentin CZERYBA Date: Wed, 9 Jul 2025 23:05:50 +0200 Subject: [PATCH] full translate for ItemListMenu pages --- covas_mobile/lib/l10n/app_en.arb | 8 +++++++- covas_mobile/lib/l10n/app_fr.arb | 8 +++++++- covas_mobile/lib/pages/ListItemMenu.dart | 25 ++++++++++++++---------- 3 files changed, 29 insertions(+), 12 deletions(-) diff --git a/covas_mobile/lib/l10n/app_en.arb b/covas_mobile/lib/l10n/app_en.arb index 30148c9..894ba7b 100644 --- a/covas_mobile/lib/l10n/app_en.arb +++ b/covas_mobile/lib/l10n/app_en.arb @@ -11,5 +11,11 @@ "english": "English", "select_language": "Select language", "search_item": "Search by item", -"search_tag": "Search by tags" +"search_tag": "Search by tags", +"search_geographical": "Search by geographical zone", +"show_date_field": "Show Date Fields", +"hide_date_field": "Hide Date Fields", +"no_data": "No data available", +"search": "Search", +"no_events": "No events available for this location." } \ 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 1e32e7b..d85d8c2 100644 --- a/covas_mobile/lib/l10n/app_fr.arb +++ b/covas_mobile/lib/l10n/app_fr.arb @@ -11,5 +11,11 @@ "english": "Anglais", "select_language": "Selectionne la langue", "search_item": "Recherche par item", -"search_tag": "Recherche par tags" +"search_tag": "Recherche par tags", +"search_geographical": "Recherche par zone géographique", +"show_date_field": "Afficher champ date", +"hide_date_field": "Cacher Date Fields", +"no_data": "Aucune donnée disponible", +"search": "Recherche", +"no_events": "No events available for this location." } \ No newline at end of file diff --git a/covas_mobile/lib/pages/ListItemMenu.dart b/covas_mobile/lib/pages/ListItemMenu.dart index d22f387..eeb288a 100644 --- a/covas_mobile/lib/pages/ListItemMenu.dart +++ b/covas_mobile/lib/pages/ListItemMenu.dart @@ -733,7 +733,8 @@ class _MyHomePageState extends State { if ((showDateFields) && (showInputGeo)) _buildSearchField( controller: inputGeo, - labelText: 'Search by geographical zone', + labelText: + loc?.search_geographical ?? 'Search by geographical zone', onChanged: (value) async { _fetchCount = 0; @@ -804,21 +805,26 @@ class _MyHomePageState extends State { : Icons.keyboard_arrow_down, color: Colors.blue, ), - tooltip: showDateFields ? 'Show Date Fields' : 'Hide Date Fields', + tooltip: showDateFields + ? loc?.show_date_field ?? 'Show Date Fields' + : loc?.hide_date_field ?? 'Hide Date Fields', ), Expanded( child: FutureBuilder>( future: postsFuture, builder: (context, snapshot) { if (snapshot.connectionState == ConnectionState.waiting) { - return const Center(child: CircularProgressIndicator()); + return Center(child: CircularProgressIndicator()); } else if (snapshot.hasData) { final posts = snapshot.data!; final displayedPosts = filteredPosts.isEmpty ? posts : filteredPosts; return buildPosts(displayedPosts); } else { - return const Text("No data available"); + return Center( + child: Text(AppLocalizations.of(context)?.no_data ?? + "No data available"), + ); } }, ), @@ -828,7 +834,7 @@ class _MyHomePageState extends State { floatingActionButton: FloatingActionButton( onPressed: popCamera, backgroundColor: Colors.blue, - tooltip: 'Recherche', + tooltip: loc?.search ?? 'Recherche', child: const Icon(Icons.photo_camera, color: Colors.white), ), ); @@ -836,14 +842,13 @@ class _MyHomePageState extends State { // Function to display fetched data on screen Widget buildPosts(List posts) { - print("posts : ${posts}"); - print("filteredposts : ${filteredPosts}"); final displayedPosts = filteredPosts; - print("results ${displayedPosts}"); // If filteredPosts is empty, show a message saying no data is available if (displayedPosts.isEmpty) { - return const Center( - child: Text('No events available for this location.', + return Center( + child: Text( + AppLocalizations.of(context)?.no_events ?? + 'No events available for this location.', style: TextStyle(fontSize: 18, color: Colors.grey)), ); }