Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide verification functions #66

Open
cromefire opened this issue Dec 11, 2024 · 0 comments
Open

Provide verification functions #66

cromefire opened this issue Dec 11, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@cromefire
Copy link

cromefire commented Dec 11, 2024

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.

@michaelbromley michaelbromley added the enhancement New feature or request label Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants