forked from bartholomej/ngx-translate-extract
-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Labels
enhancementNew feature or requestNew feature or request
Description
It would be great id you could provide a function that can check whether the translation files are complete (and maybe also sorted correctly if --sort
is enabled).
The intended usage where I think this can help is in the CI to check whether everything was translated. Alternatively you can just execute a merge in the CI and try to check, whether git thinks they changed, but that would probably be a pretty annoying and wasteful thing to do (and easy to misconfigure).
With that function I'd expect something like:
ngx-translate-extract --format-indentation ' ' --sort --input ./src/app --output ./public/i18n/{en,de}.json --null-as-default-value --check --format namespaced-json
And it'd say something like this:
All translations present
or
Error: Key "some.random.key" is missing from file "public/i18n/en.json"
or
Error: Key "some.random.key" from file "public/i18n/en.json" is not used
or
Error: Key "some.random.key" in file "public/i18n/en.json" is null
or
Error: Keys in file "public/i18n/en.json" are not sorted
(And exit with a non-zero exit status in the error cases)
I think that'd help people to not forget to translate something.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request