From c0edcc3a21b445dbc2eaa47baadd15788170d4a2 Mon Sep 17 00:00:00 2001 From: Tien Do Nam Date: Thu, 21 Dec 2023 23:10:57 +0100 Subject: [PATCH] release: 3.28.0 --- slang/CHANGELOG.md | 5 +++ slang/README.md | 78 +++++++++++++++++---------------- slang/pubspec.yaml | 2 +- slang_build_runner/CHANGELOG.md | 4 ++ slang_build_runner/pubspec.yaml | 4 +- slang_flutter/CHANGELOG.md | 4 ++ slang_flutter/pubspec.yaml | 4 +- 7 files changed, 58 insertions(+), 43 deletions(-) diff --git a/slang/CHANGELOG.md b/slang/CHANGELOG.md index 74530ac4..fc371e73 100644 --- a/slang/CHANGELOG.md +++ b/slang/CHANGELOG.md @@ -1,3 +1,8 @@ +## 3.28.0 + +- feat: add `fallback_strategy: base_locale_empty_string` to also treat empty strings as missing translations (#180) +- fix: special case where linked translations had invalid parenthesis (#181) + ## 3.27.0 - feat: add support for ARB files (#179) diff --git a/slang/README.md b/slang/README.md index 8cc93f21..ba2d8380 100644 --- a/slang/README.md +++ b/slang/README.md @@ -410,43 +410,43 @@ targets: -| Key | Type | Usage | Default | -|-------------------------------------|------------------------------------|--------------------------------------------------------------|----------------| -| `base_locale` | `String` | locale of default json | `en` | -| `fallback_strategy` | `none`, `base_locale` | handle missing translations [(i)](#-fallback) | `none` | -| `input_directory` | `String` | path to input directory | `null` | -| `input_file_pattern` | `String` | input file pattern, must end with .json, .yaml, .csv, .arb | `.i18n.json` | -| `output_directory` | `String` | path to output directory | `null` | -| `output_file_name` | `String` | output file name | `null` | -| `output_format` | `single_file`, `multiple_files` | split output files [(i)](#-output-format) | `single_file` | -| `locale_handling` | `Boolean` | generate locale handling logic [(i)](#-dependency-injection) | `true` | -| `flutter_integration` | `Boolean` | generate flutter features [(i)](#-dart-only) | `true` | -| `namespaces` | `Boolean` | split input files [(i)](#-namespaces) | `false` | -| `translate_var` | `String` | translate variable name | `t` | -| `enum_name` | `String` | enum name | `AppLocale` | -| `class_name` | `String` | name of the translations class | `Translations` | -| `translation_class_visibility` | `private`, `public` | class visibility | `private` | -| `key_case` | `null`, `camel`, `pascal`, `snake` | transform keys (optional) [(i)](#-recasing) | `null` | -| `key_map_case` | `null`, `camel`, `pascal`, `snake` | transform keys for maps (optional) [(i)](#-recasing) | `null` | -| `param_case` | `null`, `camel`, `pascal`, `snake` | transform parameters (optional) [(i)](#-recasing) | `null` | -| `string_interpolation` | `dart`, `braces`, `double_braces` | string interpolation mode [(i)](#-string-interpolation) | `dart` | -| `flat_map` | `Boolean` | generate flat map [(i)](#-dynamic-keys--flat-map) | `true` | -| `translation_overrides` | `Boolean` | enable translation overrides [(i)](#-translation-overrides) | `false` | -| `timestamp` | `Boolean` | write "Built on" timestamp | `true` | -| `statistics` | `Boolean` | write statistics (locale and string count) | `true` | -| `maps` | `List` | entries which should be accessed via keys [(i)](#-maps) | `[]` | -| `pluralization`/`auto` | `off`, `cardinal`, `ordinal` | detect plurals automatically [(i)](#-pluralization) | `cardinal` | -| `pluralization`/`default_parameter` | `String` | default plural parameter [(i)](#-pluralization) | `n` | -| `pluralization`/`cardinal` | `List` | entries which have cardinals | `[]` | -| `pluralization`/`ordinal` | `List` | entries which have ordinals | `[]` | -| ``/`enum` | `List` | DEPRECATED: context forms [(i)](#-custom-contexts--enums) | no default | -| ``/`paths` | `List` | DEPRECATED: entries using this context | `[]` | -| ``/`default_parameter` | `String` | default parameter name | `context` | -| ``/`generate_enum` | `Boolean` | generate enum | `true` | -| `children of interfaces` | `Pairs of Alias:Path` | alias interfaces [(i)](#-interfaces) | `null` | -| `obfuscation`/`enabled` | `Boolean` | enable obfuscation [(i)](#-obfuscation) | `false` | -| `obfuscation`/`secret` | `String` | obfuscation secret (random if null) [(i)](#-obfuscation) | `null` | -| `imports` | `List` | generate import statements | `[]` | +| Key | Type | Usage | Default | +|-------------------------------------|---------------------------------------------------|--------------------------------------------------------------|----------------| +| `base_locale` | `String` | locale of default json | `en` | +| `fallback_strategy` | `none`, `base_locale`, `base_locale_empty_string` | handle missing translations [(i)](#-fallback) | `none` | +| `input_directory` | `String` | path to input directory | `null` | +| `input_file_pattern` | `String` | input file pattern, must end with .json, .yaml, .csv, .arb | `.i18n.json` | +| `output_directory` | `String` | path to output directory | `null` | +| `output_file_name` | `String` | output file name | `null` | +| `output_format` | `single_file`, `multiple_files` | split output files [(i)](#-output-format) | `single_file` | +| `locale_handling` | `Boolean` | generate locale handling logic [(i)](#-dependency-injection) | `true` | +| `flutter_integration` | `Boolean` | generate flutter features [(i)](#-dart-only) | `true` | +| `namespaces` | `Boolean` | split input files [(i)](#-namespaces) | `false` | +| `translate_var` | `String` | translate variable name | `t` | +| `enum_name` | `String` | enum name | `AppLocale` | +| `class_name` | `String` | name of the translations class | `Translations` | +| `translation_class_visibility` | `private`, `public` | class visibility | `private` | +| `key_case` | `null`, `camel`, `pascal`, `snake` | transform keys (optional) [(i)](#-recasing) | `null` | +| `key_map_case` | `null`, `camel`, `pascal`, `snake` | transform keys for maps (optional) [(i)](#-recasing) | `null` | +| `param_case` | `null`, `camel`, `pascal`, `snake` | transform parameters (optional) [(i)](#-recasing) | `null` | +| `string_interpolation` | `dart`, `braces`, `double_braces` | string interpolation mode [(i)](#-string-interpolation) | `dart` | +| `flat_map` | `Boolean` | generate flat map [(i)](#-dynamic-keys--flat-map) | `true` | +| `translation_overrides` | `Boolean` | enable translation overrides [(i)](#-translation-overrides) | `false` | +| `timestamp` | `Boolean` | write "Built on" timestamp | `true` | +| `statistics` | `Boolean` | write statistics (locale and string count) | `true` | +| `maps` | `List` | entries which should be accessed via keys [(i)](#-maps) | `[]` | +| `pluralization`/`auto` | `off`, `cardinal`, `ordinal` | detect plurals automatically [(i)](#-pluralization) | `cardinal` | +| `pluralization`/`default_parameter` | `String` | default plural parameter [(i)](#-pluralization) | `n` | +| `pluralization`/`cardinal` | `List` | entries which have cardinals | `[]` | +| `pluralization`/`ordinal` | `List` | entries which have ordinals | `[]` | +| ``/`enum` | `List` | DEPRECATED: context forms [(i)](#-custom-contexts--enums) | no default | +| ``/`paths` | `List` | DEPRECATED: entries using this context | `[]` | +| ``/`default_parameter` | `String` | default parameter name | `context` | +| ``/`generate_enum` | `Boolean` | generate enum | `true` | +| `children of interfaces` | `Pairs of Alias:Path` | alias interfaces [(i)](#-interfaces) | `null` | +| `obfuscation`/`enabled` | `Boolean` | enable obfuscation [(i)](#-obfuscation) | `false` | +| `obfuscation`/`secret` | `String` | obfuscation secret (random if null) [(i)](#-obfuscation) | `null` | +| `imports` | `List` | generate import statements | `[]` | ## Main Features @@ -1210,7 +1210,7 @@ assets/ By default, you must provide all translations for all locales. Otherwise, you cannot compile it. -In case of rapid development, you can turn off this feature. Missing translations will fallback to base locale. +In case of rapid development, you can turn off this feature. Missing translations will fall back to base locale. ```yaml # Config @@ -1234,6 +1234,8 @@ fallback_strategy: base_locale # add this } ``` +To also treat empty strings as missing translations, set `fallback_strategy: base_locale_empty_string`. + ### ➤ Comments You can add comments in your translation files. diff --git a/slang/pubspec.yaml b/slang/pubspec.yaml index 4a00a9b6..840b456c 100644 --- a/slang/pubspec.yaml +++ b/slang/pubspec.yaml @@ -1,6 +1,6 @@ name: slang description: Localization / Internationalization (i18n) solution. Use JSON, YAML, CSV, or ARB files to create typesafe translations via source generation. -version: 3.27.0 +version: 3.28.0 repository: https://github.com/slang-i18n/slang topics: - i18n diff --git a/slang_build_runner/CHANGELOG.md b/slang_build_runner/CHANGELOG.md index f13b9fd3..358a89ef 100644 --- a/slang_build_runner/CHANGELOG.md +++ b/slang_build_runner/CHANGELOG.md @@ -1,3 +1,7 @@ +## 3.28.0 + +- Bump `slang` to `3.28.0` + ## 3.27.0 - Bump `slang` to `3.27.0` diff --git a/slang_build_runner/pubspec.yaml b/slang_build_runner/pubspec.yaml index fd2f92d5..148c1deb 100644 --- a/slang_build_runner/pubspec.yaml +++ b/slang_build_runner/pubspec.yaml @@ -1,6 +1,6 @@ name: slang_build_runner description: build_runner integration for slang. This library ensures that slang is recognized by build_runner. -version: 3.27.0 +version: 3.28.0 repository: https://github.com/slang-i18n/slang environment: @@ -11,4 +11,4 @@ dependencies: glob: ^2.0.2 # Use a tight version to ensure that all features are available - slang: '>=3.27.0 <3.28.0' + slang: '>=3.28.0 <3.29.0' diff --git a/slang_flutter/CHANGELOG.md b/slang_flutter/CHANGELOG.md index 08280a28..754b870d 100644 --- a/slang_flutter/CHANGELOG.md +++ b/slang_flutter/CHANGELOG.md @@ -1,3 +1,7 @@ +## 3.28.0 + +- Bump `slang` to `3.28.0` + ## 3.27.0 - Bump `slang` to `3.27.0` diff --git a/slang_flutter/pubspec.yaml b/slang_flutter/pubspec.yaml index 172f334f..dc61b054 100644 --- a/slang_flutter/pubspec.yaml +++ b/slang_flutter/pubspec.yaml @@ -1,6 +1,6 @@ name: slang_flutter description: Flutter support for slang. This library provides helpful Flutter API. -version: 3.27.0 +version: 3.28.0 repository: https://github.com/slang-i18n/slang environment: @@ -12,7 +12,7 @@ dependencies: sdk: flutter # Use a tight version to ensure that all features are available - slang: '>=3.27.0 <3.28.0' + slang: '>=3.28.0 <3.29.0' dev_dependencies: flutter_test: