0.3.5 • Published 12 months ago

i18n-locale-lint v0.3.5

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

i18n-locale-lint

This is a package to check JSON/YAML locale files to ensure that all keys are present in each file. It's particularly useful in multilingual applications to guarantee that all languages have the same set of keys.

Run

If you have your locale files at "src/locale" directory, run:

$ npx run i18n-locale-lint ./src/locale/**/*.json

Or if you define an npm script with this library, it's recommended to enclose the glob pattern within double quotes as like below.

{
  "scripts": {
    "i18n-lint": "i18n-locale-lint \"./src/locale/**/*.json\""
  }
}

Options

FlagShort FlagDescription
--silent-sDon't display logs other than errors.
--skip-top-levelAssuming the top level is composed solely of a single key, skip it.
--grouped-by-gGroup locale file by a regular expression. (-g "^(.*/)([^/]+)$" by default)
--group-sizeIf it is specified, fails when the size of a group is not equal to it.
--ignoreIgnore some files by globs. You can set this value multiple times.