modular_l10n 3.0.0
modular_l10n: ^3.0.0 copied to clipboard
Lightweight locale utilities for Flutter with RTL detection, locale parsing, display names for 70+ languages. Works standalone or with Modular Flutter L10n extension.
3.0.0 #
Major release — expanded language coverage, new metadata APIs, and a modular file structure. Fully backward compatible with v2.0.0.
Language Coverage (Phase 1) #
- Expanded from 75 to 177 languages (English names + native names)
- Added all missing ISO 639-1 languages across European, African, South Asian, Southeast Asian, Pacific, Middle Eastern, Caucasus, and other language groups
- RTL language set expanded from 10 to 16 languages (added Aramaic, Central Kurdish/Sorani, Khowar, Kashmiri, Syriac, Balochi)
- Script code recognition expanded from 15 to 35 script codes (added Gurmukhi, Gujarati, Tamil, Telugu, Kannada, Malayalam, Sinhala, Myanmar, Khmer, Lao, Tibetan, Mongolian, Canadian Syllabics, Cherokee, Tifinagh, N'Ko, Syriac, Thaana, and more)
New Models (Phase 2, 4, 8) #
LocaleInfo— bundlesenglishName,nativeName,textDirection,scriptCode, andcountryCodefor any localeNumberFormatInfo— decimal separator, grouping separator, percent sign, and numeral system per localeWritingSystemInfo—hasUpperCase,isLogographic,usesWordSpaces,isAbugida,isRtl- New enums:
PluralCategory,NumeralSystem,CalendarSystem,DateOrder
New APIs on LocaleUtils #
getLocaleInfo(locale)→LocaleInfogetCountryName(code)→String?— ISO 3166-1 country code to English name (~150 countries)getFullDisplayName(locale)→String— e.g."Arabic (Egypt)"getFullNativeDisplayName(locale)→String— e.g."العربية (مصر)"getPluralCategory(locale, n)→PluralCategory— CLDR plural rules for all major languagesgetNumberFormat(locale)→NumberFormatInfogetNumeralSystem(locale)→NumeralSystemgetFirstDayOfWeek(locale)→int(1=Monday, 6=Saturday, 7=Sunday)getDefaultCalendar(locale)→CalendarSystemgetDateOrder(locale)→DateOrdergetRelatedLocales(locale)→List<Locale>— mutually intelligible language fallbacksisValidLanguageCode(code)→boolisValidCountryCode(code)→boolisValidLocale(locale)→boolnormalizeLocale(string)→Locale— handles case normalization and deprecated code mappinggetWritingSystem(locale)→WritingSystemInfogetTextExpansionFactor(locale)→double— approximate UI text expansion relative to EnglishfindBestMatchgains an optionaluseFallbackChainparameter for intelligent language fallbacks (e.g. Norwegian Bokmål → Norwegian → Danish)
New Extensions on Locale #
All new LocaleUtils methods are also available as extension getters/methods on Locale: countryDisplayName, fullDisplayName, fullNativeDisplayName, pluralCategory(n), numeralSystem, firstDayOfWeek, calendarSystem, dateOrder, writingSystem, textExpansionFactor, isValid
Validation & Normalization (Phase 7) #
- Deprecated ISO 639 code mapping:
iw→he,in→id,jw→jv,ji→yi,mo→ro,sh→sr,tl→fil
Code Organization (Phase 9) #
- Package split into a modular file structure under
lib/src/with separatedata/,models/, and logic files - All existing APIs preserved with identical signatures — no breaking changes
2.0.0 #
- Simplified the package and removed the LocaleProvider widget
1.0.2 #
- Reverted context.currentLocale / context.isLocale() back to LocaleProvider.of(this) — no longer needed for the fix
1.0.1 #
- Added
onBeforeLocaleChangedcallback to allow custom logic before locale changes occur
1.0.0 #
- Initial release of modular_l10n package
- Modular approach to Flutter localization
- RTL support
- Locale utilities
- Cross-project module reuse