Sub topic 13
Declaring supported languages on iOS and other platforms
This chapter assumes that you have configured flutter_localizations, generated AppLocalizations, and supplied supportedLocales to MaterialApp. That list tells Flutter which locales the app can render. Platform configuration tells the operating system which languages the app supports.
These are related but separate settings. If they disagree, Flutter may render a translation correctly while the app does not appear under the operating system's language choices.
Keep the locale lists consistent
Suppose your ARB files define English and Spanish:
app_en.arbrepresentsen.app_es.arbrepresentses.
Your Dart configuration should include both locales:
MaterialApp(
localizationsDelegates: AppLocalizations.localizationsDelegates,
supportedLocales: AppLocalizations.supportedLocales,
home: const TripScreen(),
)AppLocalizations.supportedLocales is generated from the ARB files. It is usually safer than maintaining a second manual list in Dart.
Use the same locale identifiers in platform files:
| Layer | Example setting | Purpose |
|---|---|---|
| ARB files | `@@locale`: `en`, `es` | Defines available translations |
| Flutter | `supportedLocales` | Controls locale resolution |
| iOS and macOS | `CFBundleLocalizations` | Declares languages to Apple platforms |
| Android | `locale-config` | Declares languages to Android settings |
Declare languages on iOS and macOS
Add CFBundleLocalizations to ios/Runner/Info.plist:
<key>CFBundleLocalizations</key>
<array>
<string>en</string>
<string>es</string>
</array>This declaration helps iOS identify the languages supported by the application. It also makes the languages available to system features such as an app-specific language picker on supported iOS versions.
For a macOS Flutter target, add the same key and values to macos/Runner/Info.plist. If you use Xcode's project settings instead, add the equivalent language entries under the target's localizations settings. Do not add a language unless the matching ARB file exists.
Region-specific locales use identifiers such as en-GB or es-MX when those are the locales your application actually supports. Keep the spelling and region consistent across ARB metadata, Dart configuration, and platform settings.
Declare languages on Android
Android 13 and later can show an application-language picker. Declare the available languages in a locale configuration resource.
Create android/app/src/main/res/xml/locales_config.xml:
<?xml version="1.0" encoding="utf-8"?>
<locale-config xmlns:android="http://schemas.android.com/apk/res/android">
<locale android:name="en" />
<locale android:name="es" />
</locale-config>Reference that file from the <application> element in android/app/src/main/AndroidManifest.xml:
<application
android:name="${applicationName}"
android:label="Trip Planner"
android:icon="@mipmap/ic_launcher"
android:localeConfig="@xml/locales_config">
<!-- Activities and other settings remain here. -->
</application>The resource list and the generated Flutter list should describe the same locales. Android can expose a language that Flutter cannot resolve if these lists drift apart.
Other targets and verification
Flutter web normally follows the browser locale, and Linux and Windows do not use one universal localization declaration equivalent to Info.plist. Configure supportedLocales in Flutter, then use each platform's documented packaging settings only when that platform provides an app-language picker.
After changing platform files, rebuild the application. A hot reload does not reload native manifests or property lists.
Exercise
You add a French ARB file but do not add fr to the iOS plist or Android locale configuration. What can happen?
Show answer
Flutter can still render French when its locale is selected programmatically, but the operating system may not list French as an available app language. Add fr to each platform declaration and rebuild.