Skip to content

not-a-string ​

Error · A value is not a string or an object.

git8n check fails on this rule.

Why it matters ​

i18next reads a string, or an object of more keys. A number, an array or null shows as a broken text, and the editor cannot write it.

Invalid ​

locales/en/common.json

json
{
  "title": "Hello"
}

locales/fr/common.json

json
{
  "title": "Bonjour",
  "tags": [
    "nouveau",
    "promo"
  ]
}
text
$ git8n check --source en
locales/fr/common.json
  error    common:tags holds an array.  not-a-string

Read more:
  not-a-string  https://git8n.sakuga.dev/docs/reference/rules/not-a-string.html

1 error, 0 warnings 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 ​

Write the text as a string. Put a list in more keys, or join it in one text.

All the rules · The command check