i18next-parser icon indicating copy to clipboard operation
i18next-parser copied to clipboard

Warn about any missing / empty translations

Open velosipedist opened this issue 4 years ago • 2 comments

🚀 Feature Proposal

Add an execution flag to report any missing / empty translations. Like this:

i18next -w
...
Warning: Missing 123 translation keys:
Warning: Missing translation key: "common:foo.bar.note"
...etc

Motivation

Should be useful for CI needs, to prevent untranslated builds.

Example

  1. I got some new keys translated to Hindi, but forgot to add them also to Suahili strings
  2. I open a PR, build starts
  3. I see warnings about missing Suahili locale keys
  4. I finish all the unfinished stuff
  5. Build is ok 😎

velosipedist avatar Nov 24 '20 05:11 velosipedist

It sounds like a good idea to me. You are welcome to open a PR and I will review it.

karellm avatar Nov 24 '20 13:11 karellm

For a quick local test, I used https://github.com/andreyvit/json-diff that did the job for me:

npx json-diff a.json b.json --keys-only

jdeniau avatar Sep 03 '21 08:09 jdeniau