[FEATURE] Parse and convert code to YAML-code #5078
Replies: 17 comments
-
Hi @Mark-Giesen! The issue here is as follows. When content developers make content (often this is @MarleenGilsing nowadays, but I do so too) they test programs in the browser, to see if they work, let's assume I am making a new adventure for functions, then I will test like this: The corresponding code is:
Now if I want to paste this into the yaml files... I have to manually change this code into:
This is annoying! So a little script would be awesome! Maybe a new route like /hedy/12/convert-code with a textbox (does not even have to be an ace one, a simple one would already help) that:
I suspect you might also need a bit of help creating a page and a route, if you want I can add more details here! |
Beta Was this translation helpful? Give feedback.
-
This is clear enough for now. I'll have a look at it when I have some free time. |
Beta Was this translation helpful? Give feedback.
-
Thanks!
I was thinking an entirely new page, which could have an edit box and button to trigger the translation, because that might be easier for you to build than integrating into the (already a bit complex) switcher, but if you want to go that way, also fine by me! |
Beta Was this translation helpful? Give feedback.
-
I never start with easy, might end up there though. For the "nice" solution I'd like to know the difference between the language-switcher in the editor (for admins only at the moment) and the keyword-toggle in the cheatsheet. Are these different use cases? Or the same but build by others? I might combine those use case(s) with this one. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
So this translates more than just the keywords? I assume this only works with unchanged examples and startcode? I don't think we translate everything using google translate or something similar? If so, then for teachers this wouldn't be very helpful, because I would like to translate something children made in case I can't read it. |
Beta Was this translation helpful? Give feedback.
-
I'm giving a course on requirements engineering at the moment, so I'm a little more keen on clear use cases then normal :-) |
Beta Was this translation helpful? Give feedback.
-
Yes I noticed that too! I don't think that is intentional (feel free to open an issue). |
Beta Was this translation helpful? Give feedback.
-
No the switcher just translates keywords. We don't translate plain text strings or variables (that is possible but would require a lot of programming work)
No that works on all programs! We do that by parsing and re-pretty-printing. But it only works on programs without errors (with errors they don't parse -> can't be translated)
Yes, that would be a nice to have feature (maybe a fun student project?) but a lot of work for something (as you fairly note) that is not yet well scoped out. |
Beta Was this translation helpful? Give feedback.
-
haha thanks (also thanks for the context! helps me get it) I think this is very useful, because of the organic growth and changing features esp in terms of localization, this business is not so very aligned! Maybe, instead of figuring out what we have now, you can take a step back and describe what you would like in terms of features and UX? That would be very useful if you can find the time. |
Beta Was this translation helpful? Give feedback.
-
I will start with that step back. I was trying to find the clarity, but apparently it not completely clear anymore. I see three use cases that have some overlap:
And of course you can switch to an other language to translate everything, that one will remain the same. |
Beta Was this translation helpful? Give feedback.
-
Ah nice! I always saw this as different things, but I see how a toggle could also translate the coding window! Do you prefer the UX then in the top right? Or entirely different? |
Beta Was this translation helpful? Give feedback.
-
Made a discussion: #4656 |
Beta Was this translation helpful? Give feedback.
-
This is what I expected the toggle on the Cheatsheet to do. That position is fine, it will not be used by the majority, so on the top right might be a little overkill. |
Beta Was this translation helpful? Give feedback.
-
Yeah I think that makes total sense, I am not sure why I did not think of this myself. Thanks a lot!! I will update the translator button issue (#4420) |
Beta Was this translation helpful? Give feedback.
-
It would be helpfull to have a tool to change a program into YAML-code. YAML-code being the same program but with keywords surrounded with {}. This way, new adventures can be created within Hedy and once ready moved to yaml without this extra effort of adding {}.
Beta Was this translation helpful? Give feedback.
All reactions