full translate for ItemListMenu pages

This commit is contained in:
Valentin CZERYBA 2025-07-09 23:05:50 +02:00
parent 45cdb253e4
commit e21b03d13c
3 changed files with 29 additions and 12 deletions

View File

@ -11,5 +11,11 @@
"english": "English", "english": "English",
"select_language": "Select language", "select_language": "Select language",
"search_item": "Search by item", "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."
} }

View File

@ -11,5 +11,11 @@
"english": "Anglais", "english": "Anglais",
"select_language": "Selectionne la langue", "select_language": "Selectionne la langue",
"search_item": "Recherche par item", "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."
} }

View File

@ -733,7 +733,8 @@ class _MyHomePageState extends State<ListItemMenu> {
if ((showDateFields) && (showInputGeo)) if ((showDateFields) && (showInputGeo))
_buildSearchField( _buildSearchField(
controller: inputGeo, controller: inputGeo,
labelText: 'Search by geographical zone', labelText:
loc?.search_geographical ?? 'Search by geographical zone',
onChanged: (value) async { onChanged: (value) async {
_fetchCount = 0; _fetchCount = 0;
@ -804,21 +805,26 @@ class _MyHomePageState extends State<ListItemMenu> {
: Icons.keyboard_arrow_down, : Icons.keyboard_arrow_down,
color: Colors.blue, 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( Expanded(
child: FutureBuilder<List<Events>>( child: FutureBuilder<List<Events>>(
future: postsFuture, future: postsFuture,
builder: (context, snapshot) { builder: (context, snapshot) {
if (snapshot.connectionState == ConnectionState.waiting) { if (snapshot.connectionState == ConnectionState.waiting) {
return const Center(child: CircularProgressIndicator()); return Center(child: CircularProgressIndicator());
} else if (snapshot.hasData) { } else if (snapshot.hasData) {
final posts = snapshot.data!; final posts = snapshot.data!;
final displayedPosts = final displayedPosts =
filteredPosts.isEmpty ? posts : filteredPosts; filteredPosts.isEmpty ? posts : filteredPosts;
return buildPosts(displayedPosts); return buildPosts(displayedPosts);
} else { } 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<ListItemMenu> {
floatingActionButton: FloatingActionButton( floatingActionButton: FloatingActionButton(
onPressed: popCamera, onPressed: popCamera,
backgroundColor: Colors.blue, backgroundColor: Colors.blue,
tooltip: 'Recherche', tooltip: loc?.search ?? 'Recherche',
child: const Icon(Icons.photo_camera, color: Colors.white), child: const Icon(Icons.photo_camera, color: Colors.white),
), ),
); );
@ -836,14 +842,13 @@ class _MyHomePageState extends State<ListItemMenu> {
// Function to display fetched data on screen // Function to display fetched data on screen
Widget buildPosts(List<Events> posts) { Widget buildPosts(List<Events> posts) {
print("posts : ${posts}");
print("filteredposts : ${filteredPosts}");
final displayedPosts = filteredPosts; final displayedPosts = filteredPosts;
print("results ${displayedPosts}");
// If filteredPosts is empty, show a message saying no data is available // If filteredPosts is empty, show a message saying no data is available
if (displayedPosts.isEmpty) { if (displayedPosts.isEmpty) {
return const Center( return Center(
child: Text('No events available for this location.', child: Text(
AppLocalizations.of(context)?.no_events ??
'No events available for this location.',
style: TextStyle(fontSize: 18, color: Colors.grey)), style: TextStyle(fontSize: 18, color: Colors.grey)),
); );
} }