Skip to content

Configuration

Base dictionary (extends)

The extends field in i18n-kit.config.json lets a project inherit translations from a shared base — for example, a corporate terminology dictionary maintained centrally in a monorepo or npm package.

json
// i18n-kit.config.json
{
  "extends": "../../shared-i18n"
}

When the editor reads a locale, base keys are merged underneath project keys — the project always wins. Base-only keys appear in the editor but are not written to project locale files on save.

Typical structure:

monorepo/
├── shared-i18n/
│   ├── en.json     ← base dictionary (company-wide terms)
│   └── ru.json
└── my-app/
    ├── i18n-kit.config.json   ← "extends": "../shared-i18n"
    └── src/locales/
        ├── en.json   ← app-specific overrides
        └── ru.json

Locked keys

The locked field in the base config declares keys that child projects cannot modify.

jsonc
// shared-i18n/i18n-kit.config.json
{
  "localesDir": "locales",
  "locked": ["brand.name", "brand.tagline", "legal.*"],
}
LayerBehaviour
Editor UICell is greyed out with a lock icon; tooltip "Key locked by base dictionary"
PUT /api/locale/:codeServer returns 403 if a locked key value changes
merge --overwriteLocked keys are skipped even with --overwrite
pruneLocked keys are never removed

Locked key patterns support globs: "legal.*" (all keys under legal), "brand.name" (exact), "**" (everything).

Validation rules (rules)

The rules section in i18n-kit.config.json configures the locale editor's validation behaviour. All fields are optional.

jsonc
// i18n-kit.config.json
{
  "rules": {
    "interpolationPatterns": ["{var}", "{{var}}"],
    "lengthWarningFactor": 3,
    "warnOnHtmlTags": true,
    "warnOnIcuErrors": true,
    "warnOnDuplicateValues": true,
    "minValueLength": 0,
  },
}
FieldDefaultDescription
interpolationPatterns["{var}"]What counts as an interpolation variable. Also supports "{{var}}", ":param", "%(var)s".
lengthWarningFactor2.5Warn if value.length > ref.length × factor. Set to 0 to disable.
warnOnHtmlTagstrueWarn when values contain HTML tags.
warnOnIcuErrorstrueWarn on malformed ICU (unclosed braces, missing other{}).
warnOnDuplicateValuestrueWarn if a key has identical values across all locales.
minValueLength0Warn if value is shorter than this many characters (0 = off).

The same rules object can be passed to vueI18nCheckPlugin.

Ignore lists (ignore)

The ignore section lets you whitelist keys and paths that would otherwise trigger warnings or be removed by CLI tools.

jsonc
// i18n-kit.config.json
{
  "ignore": {
    "prune": ["status.*", "dynamic.*"],
    "duplicates": ["brand.name", "app.version"],
    "unused": ["seo.*", "meta.*"],
    "scanExclude": ["src/tests/**", "scripts/**"],
  },
}

All patterns support glob syntax: * matches any single segment, ** matches any number of path segments.

ignore.prune patterns are also respected by the prune --dry preview.