arb_glue 1.0.0 copy "arb_glue: ^1.0.0" to clipboard
arb_glue: ^1.0.0 copied to clipboard

ARB Glue is a tool that merges multiple files into one single [ARB] format file, facilitating the management of internationalization resources.

example/README.md

Using ARB Glue #

In this example, we'll demonstrate how to use ARB Glue to merge multiple language files into a single ARB format file.

Input Files #

Suppose we have the following directory structure containing language files:

.
└── example/
    ├── en/
    │   ├── global.yaml
    │   └── feature-1.yaml
    └── zh/
        ├── global.yaml
        └── feature-1.yaml

Contents of global.yaml (English) #

okButton:
  text: "OK"
  description: "Finish the process"
...

Contents of feature-1.yaml (English) #

$prefix: feature1
title: "Feature 1"
...

Contents of global.yaml (Chinese) #

okButton: "確定"
...

Contents of feature-1.yaml (Chinese) #

$prefix: "feature1"
title: "功能 1"
...

Using ARB Glue #

To merge these files using ARB Glue, follow these steps:

  1. Execute ARB Glue:

    dart run arb_glue --source example --destination example --base en

  2. Verify Output: After executing ARB Glue, the directory structure will be updated as follows:

     .
     └── example/
         ├── en/
         │   ├── global.yaml
         │   └── feature-1.yaml
         ├── zh/
         │   ├── global.yaml
         │   └── feature-1.yaml
         ├── en.arb
         └── zh.arb
    

Output ARB Files #

Contents of en.arb:

{
  "@@locale": "en",
  "okButton": "OK",
  "@okButton": {
    "description": "Finish the process"
  },
  "feature1Title": "Feature 1",
  "...": "..."
}

Contents of zh.arb:

{
  "@@locale": "zh",
  "okButton": "確定",
  "@okButton": {
    "description": "Finish the process"
  },
  "feature1Title": "功能 1",
  "...": "..."
}

Conclusion #

ARB Glue simplifies the process of merging multiple language files into ARB format, making it easier to manage internationalization resources in Flutter projects.

3
likes
150
points
95
downloads

Publisher

unverified uploader

Weekly Downloads

ARB Glue is a tool that merges multiple files into one single [ARB] format file, facilitating the management of internationalization resources.

Repository (GitHub)
View/report issues

Topics

#tools #arb #i18n

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

args, logging, path, yaml

More

Packages that depend on arb_glue