Localizely logo
  • Home
  • Getting started
  • How it works
  • Pricing
  • FAQ
Sign up

I18n questions

Common questions about Flutter internationalization


  • Do I need to include the country code in the locale in Flutter?

    No. However, if you want to cover more variations of the language (e.g. `es-ES`, `es-MX`, etc.), then it is required. The same applies to script codes (e.g. `zh-Hans`, `zh-Hant`, etc.). It should also be noted that it is a good practice to have a generic fallback language in order to avoid wrong language resolution.

  • How can I include a placeholder in a localization message in Flutter?

    You can use the ICU Message syntax to include placeholders. That will allow you to handle almost anything, from a simple text input to formatting numbers, dates, times, plurals, and other data types.

  • How can I use a different locale than the one defined for the whole Flutter app in one part of it?

    Overriding the inherited locale and localizations delegates for a child widget is pretty easy in Flutter. For that purpose, you only need to wrap the desired widget with the `Localizations.override` factory constructor.

  • How do I detect the device language in Flutter?

    Read `WidgetsBinding.instance.platformDispatcher.locales` for the user's preferred languages in order (`.locale` is the first one). Inside the widget tree, `Localizations.localeOf(context)` gives the locale the app actually resolved from `supportedLocales`.

  • How do I fix the intl version conflict with flutter_localizations?

    The `flutter_localizations` package ships inside the Flutter SDK with its own `intl` constraint, so a different constraint in your `pubspec.yaml` or in another package cannot be resolved. Use the `any` constraint for `intl`, match the version the SDK requires, or upgrade the conflicting package.

  • How to detect unused string keys in Flutter ARB files?

    Discover how to detect unused string keys in Flutter ARB files with our example code. By creating a command line program based on this example, you can easily streamline your localization process and improve the efficiency and organization of your Flutter project.

  • How to download localization files at runtime and use them in a Flutter app?

    Learn how to download localization files at runtime and use them in your Flutter app. Discover how to implement Over-the-Air translations update with Localizely to keep your app up-to-date with the latest translations without releasing a new version.

  • How to get a localization message with a dynamic string key value in Flutter?

    Dart does not have square brackets property accessor (`object['property']`) on class instances. Therefore, it is not possible to access localization messages in that way. However, if you want to access a certain message according to the value of a variable (e.g. the value returned from the server), you can use the ICU Select type of messages. These messages work well with a smaller set of predefined values like constants and enums.

  • How to localize Flutter app name?

    Learn how to localize your Flutter app's name with this step-by-step guide for iOS and Android platforms. Ensure your app name is properly translated and accessible to users in their preferred language.

  • How to localize server data in Flutter?

    The Flutter app and server (regular backend app, Firestore, etc.) are two separate entities that communicate over a network. Thus, the localization of both entities should be independent. The only thing that matters here is that the languages in the Flutter app and on the server side match. For that purpose, it is necessary to extend the server API endpoints with a language parameter to make the communication between these two entities compatible.

  • How to persist selected language in Flutter?

    To permanently save the app settings in Flutter, you need to store them somewhere on the device or the server. The easiest way to achieve that is with the help of the shared_preferences package.

  • How to programmatically change the locale in Flutter?

    There are several ways this can be done. The main thing is to explicitly set the `locale` prop of the `MaterialApp` widget on language change.

  • How to reference string keys in Flutter without context?

    In general, there is no clean solution here. In most cases, you'll end up with tightly coupled app layers. Passing the context to the non-widget piece of the code (e.g. model class) that needs to be localized is perhaps the simplest approach.

  • How to use localized date in Flutter?

    Learn how to use localized date in Flutter with the DateFormat class. Format dates in the user's locale and display them in a familiar format. Examples included.

  • How to use localized number in Flutter?

    Learn how to use localized number in Flutter with the NumberFormat class. Format numbers in the user's locale and display them in a familiar format. Examples included.

  • Is it possible to define a string in a Flutter ARB file that should not be translated?

    Learn how to define non-translatable strings in Flutter ARB files. Find out how to maintain consistency in your app's translations by using the same translation or a glossary in translation management systems. Read more here.

  • Is there a way I can translate my Flutter app for free?

    Learn how to translate your Flutter app for free using machine translation tools like Google Translate, but discover why using a translation management platform like Localizely offers more comprehensive features to improve the quality and efficiency of your app's localization process.

  • Why can't Flutter import package:flutter_gen/gen_l10n/app_localizations.dart anymore?

    Flutter 3.32 stopped generating the synthetic `flutter_gen` package; `flutter gen-l10n` now writes `app_localizations.dart` into your source tree, by default under `lib/l10n`. Import it from there and remove `synthetic-package` from `l10n.yaml`.

  • Why does Flutter say the application's locale is not supported by all of its localization delegates?

    At least one delegate type has no delegate that supports the resolved locale, usually because the `flutter_localizations` delegates are missing. Pass `GlobalMaterialLocalizations.delegates` (or the generated `AppLocalizations.localizationsDelegates`) to `MaterialApp.localizationsDelegates`.

  • Why does Flutter throw a LocaleDataException saying the locale data has not been initialized?

    Because `DateFormat` was used with a locale other than `en_US` before the date symbols were loaded. Call `await initializeDateFormatting()` from `package:intl/date_symbol_data_local.dart` before the first format call, for example in `main` before `runApp`.

  • Why doesn't Flutter generate localization files?

    Learn why Flutter may not generate the necessary localization files and how configuration issues with gen_l10n and cache problems with Flutter Intl are among the common reasons. Discover how to overcome these obstacles and generate the required localization files.

  • Why doesn't text direction change for RTL languages in Flutter?

    Flutter automatically sets the appropriate text direction according to the selected locale. In case you have this problem and you don't know what the cause is, check if somewhere above in the widget tree you have explicitly specified the text direction (e.g. usage of the `Directionality` widget) and if your localization library requires some additional settings.

  • Why Flutter localization does not work on iOS platform?

    Learn why localization in Flutter may not work on iOS platform and how to fix it. Discover why updating the Info.plist file with supported locales is crucial for successful localization in iOS and how it differs from Android app localization.

  • Why Flutter returns null for AppLocalizations.of(context)?

    If you're encountering a null value when attempting to access AppLocalizations.of(context) in your Flutter app, it's likely due to incorrect localization configuration. This could be caused by a failure to register AppLocalizations.delegate in the localizationsDelegates of your MaterialApp widget, or by trying to access localization messages before they are ready. Read more to find the solution.

Localizely logo
About
Free tools
Boring stuff
  • Privacy Policy
  • Terms of Service
  • Cookie Policy
Newsletter
Copyrights 2026 © Localizely