-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
Add solution to check consistency of translations #72
Comments
Flag any keys that are present in the JSON files but not used in the code |
I think we first need to check if such a tool does not already exist. Be aware that while all translated strings are stored in JSON files, they are used both in .vue and Jinja2 templates. They could theoretically soon be used in .py files. If it does not exist, then I would suggest to develop a small Python script doing the job. Be aware that we need both directions, i.e. flag any keys present in the JSON but not used in the code AND flag any keys used in the code but not present in at least This Python script should exit with non-zero exit code when problem(s) are detected, and we can add this script to invoke I will soon merge #69, so this will be easier to work on. |
@advait-zx do you confirm you will work on it, shall I assign you the issue? |
yeah but i will need help for this issue |
Isn't what I've described a sufficient start point to make progress and if needed prepare a PR? If not unfortunately I can't help more than that. |
Hi @benoit74, can I work on this issue? |
Hi @Prakhar-Shankar, sure. Note that at first, no code is needed, you need to search for a tool capable of fulfilling this issue requirements. |
Sure, I will first search for the tool, and will try to tell the approach. If the tool does not exist I will try to write a python script. I will try to provide descriptions before committing anything. |
Hi @benoit74, I found a tool called vue-i18n-extract. This tool can flag all the string that are unused or are missing. I ran the tool and here is the output - Also we can make a JSON file where the outputs can be stored. |
Seems promising! Is it possible to check all languages at once? The problem is that :
Note that we need to integrate this check to the CI, so we need to check all languages and we need a clean return code (different than 0 when there is a problem, so that it will fail the CI). |
Got it, the issue with this tool is, it can check only .vue files and not the python files. Therefore, we may have to use two different tools and later combine the result as you said. If nothing works out we may have to write a python script to check the .py files. Coming to your third point, this tool is capable of finding missing keys as well, I don't know why I didn't work, I will surely work on it and verify the process. Also I will keep in mind about the CI part. |
With #69, we have introduced i18n.
However, currently there is no tooling to ensure consistency:
en
for proper operation and inqqq
for proper TranslateWiki operation)The text was updated successfully, but these errors were encountered: