Skip to main content

CLI

The package installs the hermes command. Run it with npx hermes or from a package.json script.

hermes build​

Merges the translation files, applies the fallback languages and writes translations.json to the build directory. Required before Hermes.init(). Warns about missing, empty or outdated translations. See installation.

hermes build

hermes check​

Runs the same checks as the build, writes nothing, and fails (exit code 1) when a complete language is missing keys or a language is outdated. Use it in continuous integration.

hermes check

hermes todo <locale>​

Prints, as JSON, the keys a language still has to handle: the missing ones and the outdated ones, with the new source and the current translation.

hermes todo de

hermes lock [locales...]​

Marks translations as up to date with the current source, for the given languages (all by default).

hermes lock # every language
hermes lock de es-ES # some languages
hermes lock de --keys a,b # some keys only

The -k, --keys <keys> option takes a comma-separated list of keys and leaves the others untouched. See translation tracking for when to use it.

Tests​

To contribute, clone the repository and run:

npm install
npm run test