Convert Application Resource Bundle (ARB) translation files to other translation formats and back
npm install arb-convert!Build Status




Tool to convert JSON-based Application Resource Bundle (ARB) localization format by Google to another format and back.
``shell`
npm install -g arb-convert
ARB is the format of choice when using the Dart intl package to localize Flutter apps. It has not seen wide adoption by translation providers however. Since December 2019, Google shut down its Translator Toolkit that has natively supported the ARB format. So now Flutter devs can either migrate to another library and format, edit files by hand or convert to another format. This project aims to aid with the latter.
* XLIFF 1.2/2.0/2.1
* GNU gettext
* ... add your format, PRs welcome
Please note that ICU placeholders and plural notations are not converted.
`js
const arbConvert = require('arb-convert');
const { convertFromArb, parseToArb } = arbConvert;
const xmlString = convertFromArb('xliff-1.2', {
source: '{ "@@locale": "en-US", ... }',
target: '{ "@@locale": "de-DE", ... }', // optional
original: 'namespace', // optional
sourceLanguage: 'en-US', // optional (override)
targetLanguage: 'de-DE', // optional (override)
});
const result = parseToArb('xliff', {
content: xmlString,
});
// { source, target, original, sourceLanguage, targetLanguage }
`
`shell
Usage: arb2xliff [options]
Options:
--sourcefile
--targetfile
--original
--sourcelang
--targetlang
--outversion
--out
-h, --help output usage information
`
`shell
Usage: xliff2arb [options]
Options:
--file
--sourceout
--targetout
-h, --help output usage information
`
`shell
Usage: arb2po [options]
Options:
--sourcefile
--targetfile
--original
--sourcelang
--targetlang
--out
-h, --help output usage information
`
`shell
Usage: po2arb [options]
Options:
--file
--sourceout
--targetout
-h, --help output usage information
``