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
Avoid missing i18n translations #2626
Comments
When I submitted this issue, I was only thinking about how this would affect application code, but it turns out this is also relevant in the decision of whether we should use About Task 1, @sauloperez recommended this article which has code for this. The code sets this up not just for the test environment but also for development. Should we do the same? If we also do Task 1 for development, Task 3 will no longer be necessary because then |
I ran a CI run with exceptions on missing translations. 1c92847 Here are the results:
These may be covered in other issues: #2874, #2374, #1829. We should fix them. |
I wonder what else we have to do here after #3006 |
Integrating this into the CI build would be great! |
This is already there Matt, I wonder if it is working correclty though: |
Closing as per comment. |
Description
There doesn't seem to be an easy way right now to make sure that translation keys we use indeed have corresponding entries in the main language file.
There's a chance to miss it if a developer introduces a new translation key but forgets to add it to the language file.
And if a translation is missing, the non-underscored version of the key is used, so a missing "new_feature" appears as "New Feature" (wrapped in
span.translation_missing
). This translation often still makes sense for thedevelopment
languageen
, so you would think everything is okay when manually testing in the browser.These are small enough changes that can help us avoid these missing translations:
test
environment), raise error when encountering a missing translation key. We have good test coverage, so I think this would be very helpful.span.translation_missing
so can easily be styled.Expected Behavior
Warnings when using a translation key that is missing from the language file
Actual Behavior
No changes in actual behaviour if translations are okay
Steps to Reproduce
t("missing_key")
to a page, and check page. The page would not complain, and render this as "Missing Key".Context
Lack of confidence when adding/updating translation keys
The text was updated successfully, but these errors were encountered: