Skip to content
pubscout

flutter_localized_locales

2.0.5, released 3 years ago by guidez.pl

Provides locale code to name mappings for 563 locales in Flutter.

WASM-ready
$ flutter pub add flutter_localized_locales
Source repository

What it does

It enables obtaining localized locale names from locale codes using a LocalizationsDelegate. It also provides sorted lists of locale codes and native locale names.

AI-written summary of version 2.0.5, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to display human-readable names for locale codes in your Flutter app.
  • You want translations of locale names based on the current app locale with a fallback option.

Skip it when

  • You do not need locale code translations or only require standard date/number formatting from intl.

Strengths

  • Supports 563 locales out of the box.
  • Provides a straightforward LocalizationsDelegate for MaterialApp and CupertinoApp.
  • Allows custom fallback locales.

Weaknesses

  • Sorting by name does not respect the locale because Flutter lacks string collation API.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
1

Add LocaleNamesLocalizationsDelegate to your app's localizationsDelegates.

runApp(MaterialApp(localizationsDelegates: [LocaleNamesLocalizationsDelegate()]));

Alternatives

Packages that do the same job and could replace flutter_localized_locales.

  • language_code

    Get current device language code and locale with full ISO 639-1 and ISO 639-2 dictionaries.

  • l10n_languages

    Provides CLDR-like translations for language names across 157 locales.

  • l10n_currencies

    Provides CLDR-like currency name translations for 149 locales in pure Dart with zero dependencies.

  • locale_names

    Provide locale display names in various locales via extensions on Locale from dart:ui.

Works with

Packages commonly used together with flutter_localized_locales: ones it builds on, ones built on it, and its own family.