arb_merger

Last updated:

0 purchases

arb_merger Image
arb_merger Images
Add to Cart

Description:

arb merger

arb_merger #
The package that merge some ARB files every locale into single ARB file.
Getting Started #
Create a directories for each supported locales #
supports locales is following Locale.languageCodes.
For example:
.
├──assets
│ └── l10n
│ ├── en
│ ├── ja
copied to clipboard
Create ARB files. #
You can create ARB files as you need (min:1, max:none).
For example:
.
├──assets
│ └── l10n
│ ├── en
│ │ ├── noun.arb
│ │ └── verb.arb
│ ├── ja
│ │ ├── noun.arb
│ │ └── verb.arb
copied to clipboard
./assets/l10n/en/noun.arb:
{
"@@locale": "en",
"shop": "shop",
}
copied to clipboard
./assets/l10n/ja/noun.arb:
{
"@@locale": "ja",
"shop": "ショップ",
}
copied to clipboard
./assets/l10n/en/verb.arb:
{
"@@locale": "en",
"open": "open",
}
copied to clipboard
./assets/l10n/ja/verb.arb:
{
"@@locale": "ja",
"open": "開く",
}
copied to clipboard
Add Package #
Add the package as "dev_dependencies".
dev_dependencies:
arb_merger:
copied to clipboard
Define Settings #
Define "arb_merger" package settings in pubspec.yaml.
flutter:
.
.
,
arb_merger:
supported_locales: ["ja", "en"]
input_filepath: "assets/l10n"
output_filepath: "assets/l10n"
copied to clipboard



Name
Type
Required
Description




supported_locales
List
Required
Supported locale.


input_filepath
String
Required
input filepath.


output_filepath
String

ARB files are generated in this.



Run package #
Ensure that your current working directory is the project root. Depending on your project, run one of the following commands:
⚠️When you run this command, all arb files will be automatically sorted in ascending order by key name.
dart run arb_merger
copied to clipboard
or
flutter pub run arb_merger
copied to clipboard
ARB files are then generated in output_filepath.
The merged ARB file will be generated as "supported locale.arb".
For example:
./assets/l10n/en.arb:
{
"@@locale": "en",
"open": "open",
"shop": "shop",
}
copied to clipboard
./assets/l10n/ja.arb:
{
"@@locale": "ja",
"open": "開く",
"shop": "ショップ",
}
copied to clipboard

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.