From 0f07a3b4a9fce2c022452363d91d6aee9ef3797a Mon Sep 17 00:00:00 2001 From: Tien Do Nam Date: Fri, 30 Oct 2020 21:45:49 +0100 Subject: [PATCH] feat: prepare next release --- CHANGELOG.md | 4 ++++ README.md | 9 +++++++-- example/README.md | 9 +++++++-- pubspec.yaml | 2 +- 4 files changed, 19 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d591d43..3cd247dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.8.1 + +- Hotfix: possible NPE error when calling LocaleSettings.useDeviceLocale or LocaleSettings.setLocale + ## 1.8.0 - New advanced mode: final t = Translations.of(context) diff --git a/README.md b/README.md index a18b0050..faf60b44 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Lightweight i18n solution. Use JSON files to create typesafe translations. ```yaml dependencies: - fast_i18n: ^1.8.0 + fast_i18n: ^1.8.1 dev_dependencies: build_runner: any @@ -103,6 +103,7 @@ String translated = t.hello(name: 'Tom'); Text(t.login.success) // advanced +TranslationProvider(child: MyApp()); // wrap your app with the TranslationProvider final t = Translations.of(context); // reacts on locale changes String translateAdvanced = t.hello(name: 'Tom'); ``` @@ -111,7 +112,11 @@ String translateAdvanced = t.hello(name: 'Tom'); When the dart code has been generated, you will see some useful classes and functions -`t` - the most important translate variable +`t` - the translate variable for simple translations + +`Translations.of(context)` - translations which reacts to locale changes + +`TranslationProvider` - App wrapper, used for `Translations.of(context)` `LocaleSettings.useDeviceLocale()` - use the locale of the device diff --git a/example/README.md b/example/README.md index dfb15519..4408ec6f 100644 --- a/example/README.md +++ b/example/README.md @@ -4,7 +4,7 @@ ```yaml dependencies: - fast_i18n: ^1.8.0 + fast_i18n: ^1.8.1 dev_dependencies: build_runner: any @@ -97,6 +97,7 @@ String translated = t.hello(name: 'Tom'); Text(t.login.success) // advanced +TranslationProvider(child: MyApp()); // wrap your app with the TranslationProvider final t = Translations.of(context); // reacts on locale changes String translateAdvanced = t.hello(name: 'Tom'); ``` @@ -105,7 +106,11 @@ String translateAdvanced = t.hello(name: 'Tom'); When the dart code has been generated, you will see some useful classes and functions -`t` - the most important translate variable +`t` - the translate variable for simple translations + +`Translations.of(context)` - translations which reacts to locale changes + +`TranslationProvider` - App wrapper, used for `Translations.of(context)` `LocaleSettings.useDeviceLocale()` - use the locale of the device diff --git a/pubspec.yaml b/pubspec.yaml index bdc8be10..afeb7e42 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: fast_i18n description: Lightweight i18n solution. Use JSON files to create typesafe translations. -version: 1.8.0 +version: 1.8.1 homepage: https://github.com/Tienisto/flutter-fast-i18n environment: