-
-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Feature request: Internationalization support and moving hardcoded strings
I apologize for the issue text written with the LLM: English isn't my native language, and in this form it'll be easier to understand my point :)
Current status:
All UI strings are currently hardcoded in English directly in Dart code inside widgets. Examples:
'Followers','Routes','Detection Sensor Log', and more.
Problem:
This makes it impossible to quickly translate the interface into other languages (for example, German, Ukrainian, Russian). The standard Flutter solution is to move all strings to a formal internationalization system that allows easy translations.
What needs to be done:
- Set up the standard Flutter localization infrastructure (
flutter_localizations,.arbfiles,flutter_gen, etc.). - Extract all UI strings (labels, hints, messages, titles, etc.) from code into a separate file (e.g.,
app_en.arb). - Replace string literals with calls to the translation system, e.g.,
AppLocalizations.of(context)!.followers. - Add ARB files for other languages (e.g.,
app_ru.arbfor Russian) as needed to streamline translation. - Set up automatic generation of translations and connect the support in
MaterialApp/CupertinoApp.
Benefits:
- Enables translating the UI to other languages without touching business logic or UI code.
- Makes it easier to maintain and expand the app for non-English users.
- Improves architecture and frontend scalability.
Example tasks:
- Create an
l10n.yamlconfig file. - Extract all strings from the
<lib/features/>directory intoapp_en.arb. - Replace
Text('Followers')withText(AppLocalizations.of(context)!.followers)and similar. - Set up the build system for automatic translation generation.
Bonus:
Once set up, adding new languages is easy: just create a new .arb file with translations without touching UI code.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels