cli tool for i18n library
- Create new locale file with all keys from already existed file
- Add all keys from main locale file to all the others locales
- Merge translations from json to locale file
npm i i18n-formatter-cli -D
After instalation you can check all the command by running $ i18n-cli --help
;
- At first you need to create
.i18nfnrc.js
file with fieldslocalesDir
,mainLocale
andlocaleToMerge
. For example:
module.exports = {
localesDir: './locales',
mainLocale: 'en-gb.json',
localeToMerge: './translation/externalTranslation.json'
}
You can create .i18nfnrc.js
by running
$ i18n-cli init
- Try to use cli! Example:
$ i18n-cli init
$ i18n-cli create fileName
$ i18n-cli addAllKeys
$ i18n-cli merge fileName1 fileName2
cli can work only with json
files.
email: makarkuz@yandex.ru