modular_l10n 3.0.0 copy "modular_l10n: ^3.0.0" to clipboard
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 — bundles englishName, nativeName, textDirection, scriptCode, and countryCode for any locale
  • NumberFormatInfo — decimal separator, grouping separator, percent sign, and numeral system per locale
  • WritingSystemInfohasUpperCase, isLogographic, usesWordSpaces, isAbugida, isRtl
  • New enums: PluralCategory, NumeralSystem, CalendarSystem, DateOrder

New APIs on LocaleUtils #

  • getLocaleInfo(locale)LocaleInfo
  • getCountryName(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 languages
  • getNumberFormat(locale)NumberFormatInfo
  • getNumeralSystem(locale)NumeralSystem
  • getFirstDayOfWeek(locale)int (1=Monday, 6=Saturday, 7=Sunday)
  • getDefaultCalendar(locale)CalendarSystem
  • getDateOrder(locale)DateOrder
  • getRelatedLocales(locale)List<Locale> — mutually intelligible language fallbacks
  • isValidLanguageCode(code)bool
  • isValidCountryCode(code)bool
  • isValidLocale(locale)bool
  • normalizeLocale(string)Locale — handles case normalization and deprecated code mapping
  • getWritingSystem(locale)WritingSystemInfo
  • getTextExpansionFactor(locale)double — approximate UI text expansion relative to English
  • findBestMatch gains an optional useFallbackChain parameter 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: iwhe, inid, jwjv, jiyi, moro, shsr, tlfil

Code Organization (Phase 9) #

  • Package split into a modular file structure under lib/src/ with separate data/, 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 onBeforeLocaleChanged callback 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
0
likes
160
points
132
downloads

Documentation

Documentation
API reference

Publisher

verified publisherutanium.org

Weekly Downloads

Lightweight locale utilities for Flutter with RTL detection, locale parsing, display names for 70+ languages. Works standalone or with Modular Flutter L10n extension.

Repository (GitHub)
View/report issues

Topics

#localization #l10n #i18n #rtl

License

MIT (license)

Dependencies

flutter

More

Packages that depend on modular_l10n