node-translation-scripts

1.0.8 • Public • Published

Node Translation Scripts

i18n translation cli scripts

CLI

-h - help

Validate

--validate - Validates reference language against other translations

-r or --refLanguagePath - Path to root of directory with reference language

-t or --translationPaths - Paths to root of directories with translations delimited by comma

Export

--export - Exports translation data to specified languages

-r or --refLanguagePath - Path to root of directory with reference language

-t or --translationPaths - Paths to root of directories with translations delimited by comma

-k or --keepOriginalTranslations - Determines whether original translations should be preserved or not

-o or --outputPath - Path to output directory

-i or --includeReferenceLanguage - Include reference language

Import

--import - Imports translated data to specified directory

-i or --inputPath - Path to directory with translated files

-o or --outputPath - Path to output directory

-r or --referenceLanguage - Reference language (won't be imported)

-d or --dry - Dry run

Example

{
  ...
  "scripts": {
    "validate-translations": "node-translation-scripts --validate -r \"./public/locales/en/\" -t \"./public/locales/cs/\"",
    "validate-translations:dry": "node-translation-scripts --validate -r \"./public/locales/en/\" -t \"./public/locales/cs/\" --dry",
    "export-translations": "node-translation-scripts --export -r \"./public/locales/en/\" -t \"./public/locales/cs/\" -o \"./export/translations/\" -k -i",
    "import-translations": "node translation-scripts --import -i \"./export/translations\" -o \"./public/locales/\" -r \"en\""
  }
  ...
}

Package Sidebar

Install

npm i node-translation-scripts

Weekly Downloads

170

Version

1.0.8

License

MIT

Unpacked Size

20.7 kB

Total Files

20

Last publish

Collaborators

  • vojtechportes