2.1.2 • Published 5 years ago
@mojang/i18n-scripts v2.1.2
i18n scripts
Contributing
We are not accepting external contributions at this point in time.
Prerequisites
To work correctly this package requires a gettext installation.
Install
$ npm i @mojang/i18n-scriptsScripts
add-missing-en
Adds english default translation using keys in pot file as base translation.
example
$ add-missing-enmerge-translations
Helper function around gettext msgmerge.
example
$ merge-translationsgenerate-json
Generates json files from po files that can be consumed by Jed.
| flag | action |
|---|---|
| --o (optional) | When set, sets output file |
| --lowercase (optional) | When set, produces lowercase filename |
| --escape-percentage (optional) | When set, appends extra percentage sign |
| --filenamesMap (optional) | When set, reads file name maps from a json file |
example
$ generate-json --lowercase --escape-percentage --filenamesMap ./i18n-map.jsonexample i18n-map.json
{
"zh-CN": ["zh-cn", "zh-hans"],
"zh-TW": ["zh-tw", "zh-hant"]
}