-
Notifications
You must be signed in to change notification settings - Fork 285
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
[FEATURE] Show translation switcher for some users #4420
Comments
There is another option, which is still available to all: the language selector in the cheatsheet. Was this meant as a replacement for this switcher in the editor, or are the use cases different? |
See #2573 for the feature mentioned above. |
After more discussion with @Mark-Giesen, we have a plan forward!! The keyword switcher, that we already support: should just also translate the code in the code box. In essence I think this is a simple fix, which could be done more or less like this:
Maybe @Mark-Giesen would like to pick this up (I think it is easier maybe than the yaml generator) |
I'm happy to take on both, but it will take some weeks before I have some spare time. End of first quarter coming up, some work deadlines to consider. |
No rush!! Happy to see your contribution when you have time. |
We discussed this in the meeting today and we have a path forward:
btw this is what I mean with the top switcher: |
I wil do a few first steps and check back in if I need help |
Fixes #4420 **Some background** I want to describe a bit of background here because this is such a lovely example of a set of very reasonable decisions leading to bad design! When we introduced the keyword languages, we added a switcher on the top of the screen, to switch all code examples in the adventures. So far so good. But we also switched start codes in the editor and translated them (since they have {}, the translation does not mean *parsing* but means grabbing from the yaml file and replacing the keywords). This happens when you have not written code yet. If you do, it does not load the startcode and then it does not translate. But... Since we seems to translate code in the editor... people thought it could also translate their own code. It actually took me a long time to figure out why people (like @Mark-Giesen) thought that that is what the button would do! This PR makes the one button translate in the editor too. **Limitations** The error handling in the translation code is currently quite limited. I tried to expand it in e08375d but it will involve extensive refactoring to do it nicely, so I prefer to do that separately. I was also planning to Rename the top switcher so that it does not show the translation emoji, but the current keyword language (so: en or nl), but this leads to some design issues (#4828 (comment)) that I also want to address separately. **Changes** * Makes the top switcher translate the program too * Removes the switcher in the editor for the admin * Gives an error message in the regular place instead of a shortlived modal * Show the top switcher, also when people are logged in, so they can use the button to switch it -> was already the case! **How to test** Set Hedy to any non-En language and write code in that language (f.e. slaap 20 in Dutch, level 4). Use the toggle and observe the keywords being translated. Create a broken program with a parse error and see the error message appear below: ![Uploading image.png…]()
In #3327 we made it so that only the admin sees the translation option in the editor:
But @Mark-Giesen would like to use it as a teacher also. I am open to the idea but the reason we removed it was that it is a bit much to show for student users. I would prefer an option in your profile to enable this (maybe only visible for teacher users)
What do you all think?
The text was updated successfully, but these errors were encountered: