-
Notifications
You must be signed in to change notification settings - Fork 289
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
[UI] Localizing level keywords #4846
Conversation
Hi @Annelein, I don't see the problem being fixed yet: But maybe I am not testing in the right way? Adding a "How to test" section to your PRs (as is also present in the template) helps people to know what to see, and understand the change a bit better. |
hedy_content.py
Outdated
for key, value in adventure_names.items(): | ||
if 'command' in key: | ||
words = value.split() | ||
adventure_names[key] = ' '.join(['{' + word + '}' if not word.isdigit() |
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.
Because we already have the curlies in the string, you can actually do this in an easier way, by applying a dictionary to the string directly! I don't know the syntax by heart but it occurs in a number of places in the code. Let mw know if you need help!
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.
I think it is this function:
Line 4 in be7fd1e
def safe_format(s: str, /, **kwargs): |
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.
@Felienne sorry I didn't add a test! I wanted to add a screenshot but I can't screenshot the Adventure options on the MyProgram page... So forgot to write a how to test haha. |
@Felienne I added the curlies because I thought it would be nice to indicate keyword adventures. Because like its done here: But I understand now the curlies are for where localization can happen internally. Let me know if you still think I should add something as an indication. |
That is a great question, should we indicate it in any way? I would think it is fine to not do it, if you want to (and if it is possible) we could add a subtle link line in the dropdown? But I can totally live without it! |
@Felienne I removed the curlies, so I think it is ready! |
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 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 #4570
How to test: Go to the My Programs page, click 'Adventures', the command adventures are now localized.