modular_l10n 1.0.0
modular_l10n: ^1.0.0 copied to clipboard
A modular approach to Flutter localization with RTL support, locale utilities, and seamless module reuse across projects. Companion package for the Modular Flutter L10n VS Code extension.
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
1.0.0 - 2024-01-15 #
Added #
- 🎉 Initial release
- 🌍 RTL Support
LocaleUtils.isRtl()- Check if a locale is RTLLocaleUtils.getTextDirection()- Get TextDirection for localeLocaleUtils.rtlLanguages- Set of RTL language codes- Support for Arabic, Hebrew, Persian, Urdu, and other RTL languages
- 🔄 LocaleProvider
LocaleProviderwidget for managing locale stateLocaleProviderStatewithcurrentLocale,setLocale(), andisLocale()- BuildContext extensions:
context.currentLocale,context.setLocale(),context.isLocale()
- 🛠️ Locale Utilities
LocaleUtils.parseLocale()- Parse locale strings (supports "en", "en_US", "en-US")LocaleUtils.findBestMatch()- Find best matching locale from supported listLocaleUtils.getDisplayName()- Get English display name for localeLocaleUtils.getNativeName()- Get native display name for locale
- 📱 Locale Extensions
locale.isRtl- Check if locale is RTLlocale.textDirection- Get TextDirectionlocale.displayName- Get English display namelocale.nativeName- Get native display name
- 📚 Base Classes
ModularL10nBase- Base class for localizationModuleL10nMixin- Mixin for module classes
Supported Languages (Display Names) #
Added display names for 40+ languages including:
- Arabic, Bengali, Bulgarian, Chinese, Croatian, Czech
- Danish, Dutch, English, Estonian, Finnish, French
- German, Greek, Gujarati, Hebrew, Hindi, Hungarian
- Indonesian, Italian, Japanese, Kannada, Korean, Latvian
- Lithuanian, Malay, Malayalam, Marathi, Norwegian, Persian
- Polish, Portuguese, Punjabi, Romanian, Russian, Serbian
- Slovak, Slovenian, Spanish, Swedish, Tamil, Telugu
- Thai, Turkish, Ukrainian, Urdu, Vietnamese