Skip to content

extra-key ​

Warning · A key is not in the source.

git8n check reports this rule as a warning. It fails only past --max-warnings.

Why it matters ​

The application never asks for the key. It is often a key that the source renamed or deleted, and its translation is lost work.

Invalid ​

locales/en/common.json

json
{
  "title": "Hello"
}

locales/fr/common.json

json
{
  "title": "Bonjour",
  "welcome": "Bienvenue"
}
text
$ git8n check --source en
locales/fr/common.json
  warning  common:welcome is not in en.  extra-key

Read more:
  extra-key  https://git8n.sakuga.dev/docs/reference/rules/extra-key.html

0 errors, 1 warning in 2 files (en → fr, 1 key).

Valid ​

locales/en/common.json

json
{
  "title": "Hello"
}

locales/fr/common.json

json
{
  "title": "Bonjour"
}
text
$ git8n check --source en
0 errors, 0 warnings in 2 files (en → fr, 1 key).

What to do ​

Delete the key, or move its text to the new key of the source. A plural form that the language does not need is an extra key too.

All the rules · The command check