Sooner or later – as a Flutter Developer – you will be tasked to – fully Internationalize the developed Flutter App. Adapting it all to the user devices or chosen languages may be more complex than you think.
Common Items to Internationalize in all Flutter target Platforms
In dart/flutter – you have control on the common elements for all platforms that you need to translate to multiple languages:
- Internalization of static labels of screens,
- translating messages from third-party packages (dart code/components)
- messages from the device platform – like requesting permissions permissions, biometrics, etc
- And the other big subsection is from third-party date sources – mostly – the backend. API communication may be contracted to return multiple types of business model responses. You must translate them to meaningful and if possible – actionable – messages.
The location where you will find them is in lib, most often – arb JSON files located in l10n sub-folder. The best place to start is the official https://docs.flutter.dev/ui/accessibility-and-internationalization/internationalization. There are also alternatives – https://pub.dev/packages/r_flutter, https://pub.dev/packages/i69n, etc .
Platform Specific Locations to archive Fully translated App
On every platform you’ll find specific items that need to be translated.
- Android
- android/app/src/main/AndroidManifest.xml – more like pointers for label – the app name and screens.
- android/app/src/main/res/values
- `strings.xml` (Localized strings for Android resources)
- `values.xml` (Localized values for Android resources)
- iOS – `lib/l10n/ios/InfoPlist.strings` (Localized info.plist keys)
- MacOS
- macos\Runner\Configs\AppInfo.xcconfig
- macos\Runner\Info.plist
- Linux
- linux\my_application.cc
- Windows
- windows\runner\main.cpp
- windows\runner\Runner.rc
- Web – web\index.html
Some years ago I’ve developed an app to keep locally your translations and have them translated with Google Translate. https://programtom.com/dev/product/license-for-translateapp-version-all-executable-build/. If I ever continue the development of this product – it will be as online service.