🌐 r13n
Developed with 💙 by Very Good Ventures 🦄
A brick that generates regionalization (r13n) code from arb files. Designed to be used in conjunction with the r13n Flutter package.
Getting Started 🚀
- Add a new yaml file to the root directory of the Flutter project called
r13n.yaml
with the following content:
arb-dir: lib/r13n/arb
template-arb-file: app_us.arb
- Next, add an
app_us.arb
file in the same directory specified byr13n.yaml
, which islib/r13n/arb
:
├── r13n
│ ├── arb
│ │ └── app_us.arb
- Following, add the regionalized strings to your
.arb
file:
app_us.arb
{
"@@region": "us",
"supportEmail": "[email protected]"
}
- To generate regionalization code use the following command:
$ mason make r13n --on-conflict overwrite
- You should see generated files in
lib/r13n/arb/gen
:
├── r13n
│ ├── arb
│ │ ├── gen
│ │ │ ├── app_regionalizations_us.g.dart
│ │ │ └── app_regionalizations.g.dart
│ │ ├── app_us.arb
Configuring r13n.yaml
⚙️
Option | Description | Default |
---|---|---|
arb-dir | Directory of the regionalized arb files. | Not supported, must be specified. |
template-arb-file | Fallback regionalization; used when the user is in a non-supported region. | Not supported, must be specified. |