Skip to content

Commit

Permalink
Updated release version and readme.
Browse files Browse the repository at this point in the history
  • Loading branch information
kwado-tech committed Sep 8, 2024
1 parent 1b14fba commit 5eea517
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/git_package_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ env:
java_version: 17
flutter_channel: 'stable'
ruby_version: '2.7.5'
release_version: '2.1.0'
release_version: '2.1.1'

jobs:
git_package_release:
Expand Down
38 changes: 38 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,44 @@ Note: You can parse the directory path to find `l10n_mapper.json` if it is not d
# provide path to directory where `l10n_mapper.json` is defined
dart pub run l10n_mapper_generator --config=lib/config # directory contains `l10n_mapper.json` configuration file
```
####
Note: Providing formatter config with `keyPredicateMatch` values, ensures matched predicate are replaced with specified value in the config e.g `{"^": "_"}` means thats all `^` found in translation-keys will be replaced with `_` (underscore) instead.

```json
// before formatting
"test^send^your^usdt": "Send your USDT (TRC-20) withdrawal to:",
```

```json
// after formatting
"test_send_your_usdt": "Send your USDT (TRC-20) withdrawal to:",
```

When a an empty value is defined for `keyPredicateMatch` like below
```dart
"keyPredicateMatch": {
"-": "",
".": "",
"^": "_",
"(": "_",
")": "_"
}
```

The translation-keys are formatted using camel-case where a key-predicate is matched for `-` and `.`. Given the previous example, the key will be formatted as below

```json
// before formatting
"test^send.your-usdt": "Send your USDT (TRC-20) withdrawal to:",
```

```json
// after formatting
"test_sendYourUsdt": "Send your USDT (TRC-20) withdrawal to:",
```

With this flexibility, one can decide to prefer camel or snake casing which are both compatible with dart method naming signature and suitable for dart generated translation objects.

####
**Helper extensions**

Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ packages:
path: "../l10n_mapper_generator"
relative: true
source: path
version: "2.1.0"
version: "2.1.1"
leak_tracker:
dependency: transitive
description:
Expand Down
5 changes: 5 additions & 0 deletions l10n_mapper_generator/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,8 @@
* Fixes readme issues
* Changed generated file extension to `.mapper.dart`.

## 2.1.1

* Fixes inconsistent formatting of placeholders
* Updated readme

39 changes: 39 additions & 0 deletions l10n_mapper_generator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,45 @@ Note: You can parse the directory path to find `l10n_mapper.json` if it is not d
# provide path to directory where `l10n_mapper.json` is defined
dart pub run l10n_mapper_generator --config=lib/config # directory contains `l10n_mapper.json` configuration file
```

####
Note: Providing formatter config with `keyPredicateMatch` values, ensures matched predicate are replaced with specified value in the config e.g `{"^": "_"}` means thats all `^` found in translation-keys will be replaced with `_` (underscore) instead.

```json
// before formatting
"test^send^your^usdt": "Send your USDT (TRC-20) withdrawal to:",
```

```json
// after formatting
"test_send_your_usdt": "Send your USDT (TRC-20) withdrawal to:",
```

When a an empty value is defined for `keyPredicateMatch` like below
```dart
"keyPredicateMatch": {
"-": "",
".": "",
"^": "_",
"(": "_",
")": "_"
}
```

The translation-keys are formatted using camel-case where a key-predicate is matched for `-` and `.`. Given the previous example, the key will be formatted as below

```json
// before formatting
"test^send.your-usdt": "Send your USDT (TRC-20) withdrawal to:",
```

```json
// after formatting
"test_sendYourUsdt": "Send your USDT (TRC-20) withdrawal to:",
```

With this flexibility, one can decide to prefer camel or snake casing which are both compatible with dart method naming signature and suitable for dart generated translation objects.

####
**Helper extensions**

Expand Down
2 changes: 1 addition & 1 deletion l10n_mapper_generator/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: l10n_mapper_generator
description: A dart package to generate localization-mapper to support parsing
dynamic translation keys (as flutter-localizations package does not yet
support this).
version: 2.1.0
version: 2.1.1
homepage: https://github.com/kwado-tech/l10n_mapper/tree/main/l10n_mapper_generator
repository: https://github.com/kwado-tech/l10n_mapper/tree/main/l10n_mapper_generator

Expand Down

0 comments on commit 5eea517

Please sign in to comment.