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

I18n questions · Flutter

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.

// Full Chinese support for CN, TW, and HK
supportedLocales: <Locale>[
  const Locale.fromSubtags(languageCode: 'zh'), // generic Chinese 'zh'
  const Locale.fromSubtags(languageCode: 'zh', scriptCode: 'Hans'), // generic simplified Chinese 'zh_Hans'
  const Locale.fromSubtags(languageCode: 'zh', scriptCode: 'Hant'), // generic traditional Chinese 'zh_Hant'
  const Locale.fromSubtags(languageCode: 'zh', scriptCode: 'Hans', countryCode: 'CN'), // 'zh_Hans_CN'
  const Locale.fromSubtags(languageCode: 'zh', scriptCode: 'Hant', countryCode: 'TW'), // 'zh_Hant_TW'
  const Locale.fromSubtags(languageCode: 'zh', scriptCode: 'Hant', countryCode: 'HK'), // 'zh_Hant_HK'
],

Published Feb 1, 2023 · Last reviewed Oct 9, 2026 · Markdown version

Related Flutter internationalization questions:

Flutter internationalization tutorial:

Learn about internationalization in Flutter
Localizely logo
About
Free tools
Boring stuff
  • Privacy Policy
  • Terms of Service
  • Cookie Policy
Newsletter
Copyrights 2026 © Localizely