diff --git a/frontend/mobile/lib/components/trad.dart b/frontend/mobile/lib/components/trad.dart index d4262266..81a1578e 100644 --- a/frontend/mobile/lib/components/trad.dart +++ b/frontend/mobile/lib/components/trad.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; -String getLocalizedString(String key, BuildContext context) { +String getAreaTrad(String key, BuildContext context) { switch (key) { case "on_new_video": return AppLocalizations.of(context)!.on_new_video; diff --git a/frontend/mobile/lib/pages/services.dart b/frontend/mobile/lib/pages/services.dart index 7129a513..0852390b 100644 --- a/frontend/mobile/lib/pages/services.dart +++ b/frontend/mobile/lib/pages/services.dart @@ -1,5 +1,6 @@ import 'package:area_mobile/components/empty_notice.dart'; import 'package:area_mobile/components/services/service_card.dart'; +import 'package:area_mobile/components/trad.dart'; import 'package:area_mobile/services/dio.dart'; import 'package:area_mobile/services/services/areas.dart'; import 'package:area_mobile/types/services.dart'; @@ -157,8 +158,14 @@ class ActionOrReactionItem extends StatelessWidget { return Card( elevation: 8, child: ListTile( - title: Text(item.id), - subtitle: Text(item.description), + title: Text(getAreaTrad(item.id.replaceAll("-", "_"), context) == "" + ? item.id + : getAreaTrad(item.id.replaceAll("-", "_"), context)), + subtitle: Text( + getAreaTrad("${item.id.replaceAll("-", "_")}_sub", context) == "" + ? item.description + : getAreaTrad( + "${item.id.replaceAll("-", "_")}_sub", context)), // Add more information if needed )); }