Flutter · One codebase, native feel
How do you localize a Flutter app?
Short answer
Use flutter_localizations with ARB files and generated localizations. Keep strings out of widgets, support plural and select messages, and test right-to-left layouts and text expansion.
The gen-l10n tool reads ARB files and generates typed localization classes. MaterialApp receives the generated delegates and supported locales. Flutter resolves the device locale against that list and rebuilds dependents when the locale changes.
{
"greeting": "Hello",
"itemCount": "{count, plural, =0{No items} one{1 item} other{{count} items}}",
"welcome": "Welcome, {name}"
}MaterialApp(
localizationsDelegates: AppLocalizations.localizationsDelegates,
supportedLocales: AppLocalizations.supportedLocales,
home: const HomePage(),
)- Never concatenate translated fragments to form a sentence
- Use plural and select messages so grammar works in every language
- Avoid fixed-width text containers where translation can expand
- Test right-to-left languages and use directional padding and alignment
- Format dates, numbers and currencies with intl using the active locale
Operational concerns
Translation is a content pipeline, not only a code change. Decide how keys are named, how missing translations are detected in CI, and how translators receive context. A missing key should fail the build or be clearly reported, not silently fall back in production without anyone noticing.
Follow-ups you should expect
Interviewers use these to check whether the first answer was understanding or memorisation.
- 1Why should you avoid concatenating translated strings?
- 2How does locale resolution choose a supported locale?
- 3What changes in a right-to-left layout?
- 4How would you catch missing translation keys in CI?
Say it in the interview
I use flutter_localizations with ARB files and generated typed classes, so strings are not hardcoded in widgets. Plurals and selects go through ICU messages rather than concatenation. I also test right-to-left layouts with directional padding, and I make missing keys visible in CI. Localization is a content pipeline, so naming and translator context matter as much as the code.
Use this as a model, not a script. Saying it in your own words is what makes it survive follow-up pressure.
Related questions
Reading is step one
Now say it out loud.
Understanding an answer and delivering it under pressure are different skills. Rehearse this topic in a live Flutter mock interview and get scored feedback on depth, clarity and confidence.