Skip to content

Commit

Permalink
feat(mobile/theme): Translation (#228)
Browse files Browse the repository at this point in the history
* feat(trad): theme traduction

* fix type
  • Loading branch information
axel-denis authored Nov 5, 2023
1 parent a477d20 commit 65f8f3d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions frontend/mobile/lib/components/trad.dart
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,12 @@ String getAreaTrad(String key, BuildContext context) {
return AppLocalizations.of(context)!.enable_workflow;
case "enable_workflow_sub":
return AppLocalizations.of(context)!.enable_workflow_sub;
case "auto":
return AppLocalizations.of(context)!.auto;
case "dark":
return AppLocalizations.of(context)!.dark;
case "light":
return AppLocalizations.of(context)!.light;
}
return "";
}
3 changes: 2 additions & 1 deletion frontend/mobile/lib/pages/user.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:area_mobile/components/trad.dart';
import 'package:area_mobile/services/dio.dart';
import 'package:area_mobile/types/services.dart';
import 'package:area_mobile/types/user/me.dart';
Expand Down Expand Up @@ -121,7 +122,7 @@ class _UserHero extends State<User> {
].map((String theme) {
return DropdownMenuItem<String>(
value: theme,
child: Text(theme),
child: Text(getAreaTrad(theme, context)),
);
}).toList(),
onChanged: (value) {
Expand Down

0 comments on commit 65f8f3d

Please sign in to comment.