Skip to content

Commit

Permalink
release: 3.28.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Tienisto committed Dec 21, 2023
1 parent db54b4b commit c0edcc3
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 43 deletions.
5 changes: 5 additions & 0 deletions slang/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
78 changes: 40 additions & 38 deletions slang/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -410,43 +410,43 @@ targets:

</details>

| 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<String>` | 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<String>` | entries which have cardinals | `[]` |
| `pluralization`/`ordinal` | `List<String>` | entries which have ordinals | `[]` |
| `<context>`/`enum` | `List<String>` | DEPRECATED: context forms [(i)](#-custom-contexts--enums) | no default |
| `<context>`/`paths` | `List<String>` | DEPRECATED: entries using this context | `[]` |
| `<context>`/`default_parameter` | `String` | default parameter name | `context` |
| `<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<String>` | 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<String>` | 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<String>` | entries which have cardinals | `[]` |
| `pluralization`/`ordinal` | `List<String>` | entries which have ordinals | `[]` |
| `<context>`/`enum` | `List<String>` | DEPRECATED: context forms [(i)](#-custom-contexts--enums) | no default |
| `<context>`/`paths` | `List<String>` | DEPRECATED: entries using this context | `[]` |
| `<context>`/`default_parameter` | `String` | default parameter name | `context` |
| `<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<String>` | generate import statements | `[]` |

## Main Features

Expand Down Expand Up @@ -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
Expand All @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion slang/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 4 additions & 0 deletions slang_build_runner/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 3.28.0

- Bump `slang` to `3.28.0`

## 3.27.0

- Bump `slang` to `3.27.0`
Expand Down
4 changes: 2 additions & 2 deletions slang_build_runner/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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'
4 changes: 4 additions & 0 deletions slang_flutter/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 3.28.0

- Bump `slang` to `3.28.0`

## 3.27.0

- Bump `slang` to `3.27.0`
Expand Down
4 changes: 2 additions & 2 deletions slang_flutter/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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:
Expand Down

0 comments on commit c0edcc3

Please sign in to comment.