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

WIP: Make sure to throw an error when no translation is found #281

Merged

Conversation

esbenam
Copy link
Contributor

@esbenam esbenam commented Jun 1, 2020

What does this PR solve?
It propagates the translation error when a translation isn't found for a given key (or if the language doesn't exist).

My colleague and I ran into this issue today while running pa11y where a missing translation resulted in an Uncaught TypeError: Cannot read property 'replace' of undefined from this package. I think this should take care of it, so we would get the right error propagated instead :)

My colleague created a minimal-reproduction-repo where you can see the error. If you use npm link to link HTML_CodeSniffer to this branch instead you can see the actual translation error getting propagated.

The weird thing though is that the specific key (1_3_5_H98.InvalidAutoComplete_Text) it complained about isn't missing in the translation file (en.js). I haven't had the time to look into that bit, but this get us halfway there :)

@ironikart ironikart self-assigned this Jun 1, 2020
@ironikart ironikart merged commit e858f21 into squizlabs:master Jun 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants