-
Notifications
You must be signed in to change notification settings - Fork 292
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
🪲 Fix error translation and highlighting #5275
Conversation
6e7b92e
to
b5548b8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this Boryana. I always love your work! I tried this, and everything looks fine, but I wanted to ask if there was a way to address #5252 in this PR as well? I think the problem in that case is that allowed_types
on the Invalid Argument
string in messages.po
18f50b6
to
c700a5b
Compare
Thanks for pointing out #5252. It does impact the logic I created indeed. The issue turned out to be that sometimes translated argument values use new keys that need to be translated in turn. As you can imagine, we can go crazy with the nested translations, so I chose to make it work with 1 level of nested translations for now. Maybe if we encounter the need to support deeper nesting (e.g. 2 or 3 levels), we will add the functionality. However, I am still hesitant about how to deal with which arguments need to be translated (the TODO: in the hedy_errors.py). I do not want to maintain a list of keys as we currently do because it is error prone. The responsibility for knowing what should be translated could lay:
Obviously this question requires a separate issue to be created. However, if anything comes to mind while you are reviewing, please let me know! |
Hi! Sorry for not replying sooner. Each one of those options I think poses its own set of problems, but in my opinion I think the third one is a nice middle ground, the first one also makes sense, and I think we haven't had issues with mistranslated fields on Weblate, so that would also be nice! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you Boryana!
Thank you for contributing! Your pull request is now going on the merge train (choo choo! Do not click update from main anymore, and be sure to allow changes to be pushed to your fork). |
Thank you for contributing! Your pull request is now going on the merge train (choo choo! Do not click update from main anymore, and be sure to allow changes to be pushed to your fork). |
Fixes #5240
How to test
In level 4:
In level 6, supply text value to the ask command instead of a number (note that currently the error should referring to the value 'a' which is not nice but will be addressed in #5005)
In level 8:
In level 16:
In level 16. Change the language and ensure that the keyword 'random' in the last example is translated correctly: