language_helper 0.13.0-rc.13
language_helper: ^0.13.0-rc.13 copied to clipboard
A Flutter package for easy multi-language app localization with automatic text extraction and translation support.
0.13.0-rc.13 #
- Change
LanguageHelper.disposeto future. - Fix race condition in
change()method by using_states.toList()to create a snapshot before iteration, preventingConcurrentModificationErrorwhen widgets are added/removed during language changes. - Fix memory leak by removing unbounded
_noScopeLoggedContextsSet and replacing withassert()block that only runs in debug mode. - Fix async operation by properly awaiting
SharedPreferences.setString()inchange()method to ensure language preference is saved before method completes. - Fix error handling by replacing
assert()statement with proper error handling and early return when language codes are empty. - Update docs.
0.13.0-rc.12 #
-
BREAKING CHANGE Change the behavior of the
initial.datafrom loading the first successful provider to loading all providers and decide to override the translations by settingoverrideparameter of each provider. The providers will be loaded from top to bottom. -
BREAKING CHANGE Remove
dataOverridesandcodesOverridesproperties fromLanguageHelper. The override functionality is now handled by theoverrideparameter inLanguageDataProviderconstructors. -
BREAKING CHANGE Remove
addDataOverridesmethod. UseaddProviderwith a provider that hasoverride: trueinstead. -
BREAKING CHANGE Rename
addDatatoaddProviderand addremoveProvidermethod for better clarity and consistency. -
BEHAVIOR CHANGE The
change()method now always reloads translation data from all providers on every language change, even if the data was previously loaded. This ensures fresh data but may impact performance for network providers. Previously, data was only loaded if it wasn't already cached. -
Add
reload()method to refresh allLanguageBuilderwidgets without changing the language. Useful after adding/removing providers withactivate: false. -
Enhance documentation throughout the codebase with comprehensive examples and usage guidelines.
-
Update README with improved examples, performance considerations, and best practices for using different provider types.
-
Update example code to use the new
addProvidermethod. -
MIGRATION
- Replace
languageHelper.addData(provider)withlanguageHelper.addProvider(provider) - Replace
languageHelper.addDataOverrides(provider)withlanguageHelper.addProvider(provider)(the provider'soverrideproperty controls whether it overwrites existing translations) - Replace
languageHelper.dataOverrideswithlanguageHelper.data(all providers are now unified) - Replace
languageHelper.codesOverrideswithlanguageHelper.codes(all language codes are now unified)
- Replace
0.13.0-rc.11 #
-
BREAKING CHANGE Remove
analyze()method fromLanguageHelper. Missing translation detection is now handled bylanguage_helper_generatorpackage. -
BREAKING CHANGE Remove
analysisKeysparameter fromLanguageHelper.initial(). The generator will automatically detect and report missing translations. -
BREAKING CHANGE The
forceRebuildparameter inLanguageHelper.initial()now defaults totrueinstead offalse. This change makes it easier to use nestedLanguageBuilderwidgets since they will rebuild by default when the language changes. Previously, only the rootLanguageBuilderwould rebuild, which made nested builders less useful. -
Update tests to reflect the removal of analysis functionality.
-
MIGRATION: If you want the old behavior (only root widgets rebuild), use
LanguageHelper.initial(forceRebuild: false).
0.13.0-rc.10 #
- BREAKING CHANGE The
LanguageHelper.initialis now safe to call multiple times. - Add
LanguageDelegatefor integrating LanguageHelper with Flutter's localization system. - Add example.
- Update README.
0.13.0-rc.9 #
- Bump
lite_loggertov0.2.0.
0.13.0-rc.8 #
- Show warning if
LanguageHelper.ofcannot find theLanguageScope.
0.13.0-rc.7 #
- Debug will show correctly for each instance.
- Use
lite_loggerfor logging. - Improve docs.
0.13.0-rc.6 #
- Change from
LanguageScope.oftoLanguageHelper.of. - Remove
LanguageScope.maybeOf. - Update docs.
0.13.0-rc.5 #
- Add
LanguageScopeto scoped LanguageHelper instances, enabling localized translations within specific widget trees. So we can usetr,trPwith a custom LanguageHelper without the need oftranslateor.trC. - Update README for
LanguageScopeandLanguageImprover(a new language package). - Bump
language_codeto^0.6.0-rc.3.
0.13.0-rc.4 #
- Add more tests.
- Improve README.
0.13.0-rc.3 #
- Update minimum Dart SDK requirement to ^3.9.0 and Flutter to >=3.35.0.
- Refactor widgets for better compatibility with the latest Flutter framework.
0.13.0-rc.2 #
- Improve README.
- Fix lint issues in example.
0.13.0-rc.1 #
-
Add
LanguageBuilder.refreshTreeto rebuild the whole tree when the language is changed. -
The
LanguageBuilderwill not find the root widget itself, theLanguageHelper.changewill do it to improve the performance. -
The recent refactor of
language_helper_generator v0.7.0now allows you to use the previous asset and network structure for greater flexibility. Thelanguage_helpersegment is no longer required in your asset or network paths, restoring compatibility with older versions.- Before: The
language_helperis required so we don't need to add it the the path/url
LanguageDataProvider.asset('assets/resources'); LanguageDataProvider.network('https://example.com/resources');- Now: The required of
language_helperis removed, so we need to add it ourself
LanguageDataProvider.asset('assets/resources/language_helper'); LanguageDataProvider.network('https://example.com/resources/language_helper'); - Before: The
-
Rewrite the example.
0.12.4 #
- Forward stdout and stderr to parent process when running the generator.
0.12.3 #
- Add exportJson helper for LazyLanguageData.
- Drop redundant key from Tr wrapper.
0.12.2 #
- Add
LazyLanguageDataandLanguageDataProvider.lazyData(LazyLanguageData data)to support lazy loading. - Improve the CLI.
0.12.1 #
- Updated Flutter dependency to
>=3.29.0.
0.12.0 #
- Updated Flutter dependency to
^3.29.0and Dart SDK to^3.7.0. - Separated the
language_helper_generatorpackage. Thedart run language_helper:generatecommand remains available and now provides clear instructions if thelanguage_helper_generatordependency is missing.
0.11.7+1 #
- Update README for plural example.
0.11.7 #
- Update the
LanguageBuilderto update the state only instead of update theKeyedSubtree. - Improve tests.
0.11.6 #
- Improve pub points.
0.11.5 #
- Add
--helpflag to the generator to show help. - Fix
LanguageConditionsTYPO in README.
0.11.4 #
- Add
constto theLanguageConditions. - Remove the
language_helperlibrary.
0.11.3+1 #
- Improve README for ios locales configuration.
0.11.3 #
- Improve the way to print the debug log.
0.11.2+1 #
- Support the web platform (only improve the list on pub.flutter-io.cn).
0.11.2 #
- Support a wider range of dependency versions.
0.11.1+1 #
- Bump
language_helper_generatorto0.5.1:- Change the generated path in Map from
'@path_1': '.lib/to/file.dart'to"@path_.lib/to/file.dart": ''
- Change the generated path in Map from
- Bump dependencies.
0.11.0 #
- Release to stable.
0.11.0-rc.8 #
- Add
trCto translate with the custom instance of LanguageHelper. - The default instance is now set to final to avoid modifying.
- Improve Tr builder.
- Update example and tests.
- Bump
language_helper_generatorto supporttrC.
0.11.0-rc.7 #
- Able to use the custom
LanguageHelperinLanguageBuilderandTr.
0.11.0-rc.6 #
- Add topics.
0.11.0-rc.5 #
- Add
isInitialized(bool) andensureInitialized(Future<void>) to check whether theinitialis run. - Update tests.
0.11.0-rc.4 #
- Improve README.
- Improve example.
0.11.0-rc.3 #
-
Improve the logic of using the temporary data while developing.
- Right:
languageHelper.initial( data: [] );- Wrong:
languageHelper.initial( data: [LanguageDataProvider.data({})], ); -
assetsdata is preferred betweenassetsandnetworkbecause we still haven't a way to cache it.
0.11.0-rc.2 #
-
The
language_helperin.assetand.networkofLanguageDataProviderare now required. So we don't need to add it into the input path:- Before:
LanguageDataProvider.asset('assets/resources/language_helper'); LanguageDataProvider.network('https://example.com/resources/language_helper');- Now:
LanguageDataProvider.asset('assets/resources'); LanguageDataProvider.network('https://example.com/resources'); -
Generator:
-
Change the default path of the Dart Map generator:
- Before:
|-- .lib | |--- resources | | |--- language_helper | | | |--- _language_data_abstract.g.dart ; This file will be overwritten when generating | | | |--- language_data.dart- Now:
|-- .lib | |--- resources | | |--- language_helper | | | |--- language_data.dart | | | |--- languages | | | | |--- _generated.dart ; This will be overwritten when re-generating -
Change the default path of the Dart Map generator:
- Before:
|-- assets | |--- language_helper | | |--- codes.json ; List of supported language code | | |--- languages | | | |--- _generated.json ; Each language will be stored in 1 files- Now:
|-- assets | |--- resources | | |--- language_helper | | | |--- codes.json | | | |--- languages | | | | |--- _generated.json ; This file will be overwritten when re-generating -
JSON generator will not overwrite the
codes.jsonwhen re-generating.
-
0.11.0-rc.1 #
- Bump min sdk to
3.0.0. - Able to create a new
LanguageHelperinstance. - Change from
LanguageDatatoLanguageDataProviderto support the data fromdata(the defaultLanguageData),asset(JSON from the local assets) andnetwork(JSON from the URL). - Multiple
LanguageDataProviderinputs are supported. - Able export JSONs from the current
LanguageData(for the migration). - Remove deprecated features.
- Improve README.
0.10.0 #
- Promote to stable.
- This release includes the BREAKING CHANGE.
0.10.0-rc.2 #
- Improve the
forceRebuildlogic.
0.10.0-rc.1 #
- Improve the
LanguageBuilderbehavior to avoid the dupplicated state issue.
0.10.0-rc #
- Bump
language_codeto 0.4.0 to support country code.- BREAKING CHANGE NOTE: The method
.fromEnglishNameand.fromNativeNamemay be broken in this version with this Changelog.
- BREAKING CHANGE NOTE: The method
- Add an instruction for the
Language Helper Translatorwith custom Chat GPT-4 in README. - Add
isOptionalCountryCodeparamenter to theinitialmethod to control the country code behavior. - Deprecates
LanguageHelper.instance.delegate->LanguageHelper.instance.delegates. - Add tests.
0.9.0+2 #
- Improve README.
0.9.0+1 #
- Improve the pub score.
0.9.0 #
- Update language_helper_generator to
0.4.1:- Completely rewritten using dart analyzer to improve reliability.
- Improve README.
0.8.0 #
- Update language_helper_generator to
0.3.0:- Convert to single quote when possible to avoid duplicated text issue.
- Able to parse a text with
rraw text tag.
- Improve README.
0.7.3 #
- Beside using 'default' in
LanguageConditionto set the default value, we can use '_' from this version.
0.7.2 #
- Update homepage URL.
0.7.1 #
- Bump dependencies.
- Update codecov URL.
0.7.0 #
- Add
syncWithDeviceparameter to sync the language with the device language, auto apply on changed. - The
initialCodewill keeps its value correctly. In the past version, theinitialCodemaybe changed to the local code (from SharedPreferences). - The
useInitialCodeWhenUnavailablenow works correcly. - Add more test cases.
0.6.0 #
- Automatically run
dart formatfor the generated files when runningdart run language_helper:generate.
0.5.5 #
- Add the flutter default localizations and how to use it.
- Increase code coverage to 100.
0.5.4 #
- Fix the error when adding the new language data to the unmodifiable Map.
0.5.3 #
- Support adding the new language data outside the
initial.
0.5.2 #
- Support changing the generating path when using the generator.
0.5.0 #
- Bump dependencies
0.4.6 #
-
Add
codesBothtoLanguageHelperin order to get theLanguageCodess from bothdataanddataOverrides(No duplicated). -
Update dependencies.
-
language_helper_generator:- Improve the commented text.
- Improve TODO text.
0.4.5 #
- Add
dataOverridestoinitialto help you override some translations that are already available in thedata.
0.4.4 #
- Update dependencies.
- Update README.
0.4.3 #
- Update dependencies.
0.4.2 #
- Improve formatting of the analysis results.
0.4.1 #
- Remove deprecated methods.
- Update
language_helper_generatorto0.1.1.
0.3.0 #
- Bump min sdk to 2.18.0.
- Bump flutter version to 3.3.0.
- Update dependencies.
0.2.7 #
- Improve test coverage (reach 99.1%).
- Set the sdk version:
">=2.17.0 <4.0.0" - Bring the release candidate to stable.
0.2.7-rc.5 #
- Fixes issues of the
LanguageDataserializer. - Improves test coverage.
0.2.7-rc.4 #
- Add
LanguageConditionsto be able to use the plural translation inLanguageData. - Add serialization for
LanguageData:- Use
data.toJson()to convert the data to JSON. - Use
LanguageDataSerializer.fromJson(json)to convert the JSON data back to theLanguageData.
- Use
- Update command to
dart run language_helper:generate. - Update test for
LanguageConditionsandLanguageDataSerializer. - Update README.
0.2.7-rc.3 #
- Mark
Lhbas deprecated, useTrinstead. - Improve README.
0.2.7-rc.2 #
- Add more details to README.
0.2.7-rc.1 #
- Add
language_helper_generatoras a build-in function. Using by commandflutter pub run language_helper:generate.
0.2.6 #
- Bring the release candidate to stable.
0.2.6-rc.4 #
- Change from
currentCodetocode, addlocaleto get the current Locale. - Add
localesto get the current list of language as Locale. - The
datais now asserted as must be not empty. initial()must be run before callingcodeorlocale, socodeandlocaleare non-null.- Add
Lhbas a short version ofLanguageBuilder. trPandtrT's parameter are now required.- Add more tests.
- Update example.
0.2.6-rc.3 #
streamnow will works even when theonChangedis not set.
0.2.6-rc.2 #
- Add
streamto LanguageHelper, you can listen for language change events.
0.2.6-rc.1 #
- Supports early state of language_helper_generator.
- Improves
onChangedreturn type. - Add
analysisKeysparameter toinitial(mostly used forlanguage_helper_generatorI think). - Improves description for the result of
analyzemethod. - Update README.
0.2.5+1 #
- Improve pub scores.
0.2.5 #
- Add
.trTextension to use onlytoCodeparameter. - Refactor internal code.
0.2.4 #
- Add
LanguageCodes.fromNameandLanguageCodes.fromNativeName. - Add
orElseparameter toLanguageCodes.fromCode,.fromNameand.fromNativeName.
0.2.3 #
- Add
toCodeparameter totranslatemethod to translate the current text to a specific code instead of the currentCode. - Add
.trFextension to use full version oftranslate. - Update README.
0.2.2 #
- Renamed from
LanguageNotifiertoLanguageBuilderand marked it as Deprecated. - Improved
LanguageBuilderbehavior.
0.2.1 #
- Use the
language_codeplugin instead of thedevicelocale.
0.2.0+3 #
- Added
isAutoSaveparameter toinitialto allow the plugin auto save and reload the language when changed and opened in the next time.
0.2.0+2 #
- You can use
@{param}instead of@paramto translate text with parameters. - Added
paramsparateters to thetranslatemethod.
0.2.0+1 #
-
[BREAKING CHANGE] the
initialmethod will returnFuture, so you need to useawaitto make it equal to before. -
The app will try use
Devicelocaleas the default language code if theinitialCodeis not set. -
Added
useInitialCodeWhenUnavailableparameter to control theLanguageCodeswhen you change to unavailable code. -
Added
trP()extension to allow replacing specific texts by values. Ex:final text = 'Hello @user'.trP({'user' : 'Vursin'}); // => Hello Vursin -
Added test.
0.1.0+2 #
- Improved the pub score.
0.1.0+1 #
- Improved function headers.
- Changed to use
debugPrint.
0.1.0 #
- [BREAK] Rename the param from
defaultCodetoinitialCode. - [FEAT] Add a param
onChangedto notify when the language is changed.
0.0.4 #
analyzewill be automatically called ininitialwhenisDebugistrue.
0.0.3 #
- [LanguageHelper] add
forceRebuildto allow the plugin to force rebuild all the widgets intead of only root widgets. - [LanguageNotifier] add
forceRebuildto allow the plugin to force rebuild this specific widget or not.
0.0.2 #
- [Feat] Add method
LanguageHelper.instance.analyze()to analyze the missing texts of all languages. - Add headers for
LanguageCodesenum.
0.0.1+1 #
- [LanguageNotifier] Only change the state of the root widgets to improve performance.
0.0.1 #
- Initial release.