playx_localization 0.1.1
playx_localization: ^0.1.1 copied to clipboard
Easily manage and update app localization with a simple implementation and a lot of utilities.
Changelog #
0.1.1 #
- enhance log messages.
0.1.0 #
Note: This release contains breaking changes.
New Features #
General Updates
- Package Updates: All packages have been updated.
intlPackage: Upgraded to version 0.19.0.
PlayxLocalizationBuilder
-
Improved Locale Management: Now uses an
InheritedWidgetto provide locale to child widgets, enhancing locale management and widget rebuilds. -
Simplified Localization Access:
- Retrieve localized text using:
'text'.tr(context: context)context.tr()Text('text').tr(context: context)
- New
BuildContextextensions:context.tr()andcontext.pluralfor easy access to localized text.
Providing context to the
trfunction ensures widgets are rebuilt correctly when the locale changes. - Retrieve localized text using:
-
For classes without context, you can still use the
trfunction without context, though note that widgets will not rebuild on locale changes when used this way, But there is an option to force app update on locale change.
PlayxLocalization
- Added a getter to retrieve the app's fallback locale.
- Added a function to get the current locale as a string with a custom separator.
- Added a function to determine if the current locale is right-to-left (RTL).
PlayxLocaleController
- Switched from
GetxControllertoValueNotifier, reducing reliance on theGetXpackage. - Updated methods (
updateTo,updateByIndex,updateById,next,updateByLanguageCode,updateToDeviceLocale) now include aforceAppUpdateparameter to allow a full app rebuild when changing the locale.
Breaking Changes #
XLocaleConfighas been renamed toPlayxLocaleConfigto align with the package name. -PlayxLocaleConfigis no longer abstract and can be instantiated directly.PlayxLocaleConfignow requires default and supported locales to be provided at instantiation.- The
trextension onStringhas been updated to a function that accepts context and additional parameters.
0.0.5 #
- Update packages.
0.0.4 #
- Update packages.
- Bump Intl version to 0.18.1.
0.0.3 #
- Update packages.
- Bump dart version to 3.0.0.
- Add number extensions for
numto format number to localized numbers String like arabic numbers. - Add
Stringextensions to check if string is rtl or is of specifc language.
0.0.2 #
- Update packages.
0.0.1 #
- Initial release.