locale_names
1.1.1, released 3 years ago by an unverified publisher
Provide locale display names in various locales via extensions on Locale from dart:ui.
What it does
Adds extension methods to the standard Locale class to easily retrieve language, script, and country display names in default, native, or specific target locales. It allows Flutter developers to present human-readable locale labels without writing custom lookup tables.
AI-written summary of version 1.1.1, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to display human-readable names of locales or languages in your Flutter application.
- You want to fetch native display names or translate locale names into specific target locales.
Skip it when
- You are looking for general app translation management frameworks like easy_localization or slang.
- You only need basic formatting already covered by the core intl package.
Strengths
- Simple extension-based API on standard dart:ui Locale objects.
- Supports default, native, and specific locale formatting.
- Lightweight with minimal dependencies.
Weaknesses
- Limited to locale display names and does not provide broader localization utilities.
- Not documented for custom advanced pluralization or number/date formatting.
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 0
Just add the dependency to pubspec.yaml and import the package.
Locale locale = Locale.fromSubtags(languageCode: 'zh', scriptCode: 'Hans', countryCode: 'CN');
print(locale.defaultDisplayLanguage);Alternatives
Packages that do the same job and could replace locale_names.
- intl
If you need comprehensive internationalization, date/number formatting, and message translation support.
93Compare - flutter_localized_locales
If you specifically need localized names for locales using Flutter's built-in localizations.
50Compare