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

🪲 code highlighting in slides does not work properly for translations on Alpha #6112

Closed
yilmazdurmaz opened this issue Jan 18, 2025 · 4 comments · Fixed by #6126
Closed
Assignees
Labels
bug Something isn't working

Comments

@yilmazdurmaz
Copy link
Contributor

Describe the bug

I am testing my translations in slides for possible errors in code fragments and saw this issue. I have also tested this on a few other languages.

Highlighting for English are fine. Translations uses plain grey for everything until level 4.
From then on, variables, quoted string, numbers are colored but mostly in different colors from English version. see screenshots below.
Some command keywords even change color depending where they are used, but they are mostly grey.

Paste the Hedy code & level
All slides

Add a screenshot (optional)

screenshot from level 1 slides
Image

screenshot from level 13 slides
Image

What machine and browser you were using (optional)
Windows 10, MS Edge latest

@yilmazdurmaz yilmazdurmaz added the bug Something isn't working label Jan 18, 2025
@yilmazdurmaz yilmazdurmaz changed the title 🪲 code highlighting in slides does not work properly for translations 🪲 code highlighting in slides does not work properly for translations on Alpha Jan 18, 2025
@yilmazdurmaz
Copy link
Contributor Author

For a moment I fell into thinking the issue is the same in prod. Highlighting works in prod Hedy slides.

I thought the backend for alpha would be the same as prod. Could this be a sign for a bug that is about to slip into prod?

@yilmazdurmaz
Copy link
Contributor Author

@boryanagoncharenko

Hi, I am sorry I may have caused a confusion here: Highlighting works on "https://hedy.org", the prod, but the problem here is about "https://hedy-alpha.herokuapp.com", the alpha.

check these two for comparison:

There are disconnections between the two deployments and this is one of them. Marking this as a bug might not be what it should be, so please act cautiously as I see you made a PR on "main".

The solution should already be in the production code, and probably just needs to be replicated to alpha.

Again, excuse me for the misunderstanding,
YILMAZ

boryanagoncharenko added a commit that referenced this issue Jan 24, 2025
boryanagoncharenko added a commit that referenced this issue Jan 24, 2025
@boryanagoncharenko
Copy link
Collaborator

Hello @yilmazdurmaz

Thank you for reporting this issue. It is indeed a bug that exists on alpha that would have slipped to production, so there was not a misunderstanding at all.

Recently we made improvements to the highlighting mechanism in Hedy, so there is no way to replicate the solution on production to alpha - we need to fix forward instead. Hopefully, my PR will address the highlighting issue in all editors.

@yilmazdurmaz
Copy link
Contributor Author

@boryanagoncharenko , it is nice.

I wasn't really sure about them, and that explains much: these things on alpha are nasties to slip prod.

I will then continue reporting my findings on alpha while checking my translations.

@mergify mergify bot closed this as completed in #6126 Jan 30, 2025
mergify bot pushed a commit that referenced this issue Jan 30, 2025
PR #6085 makes uses of `data-level` and `data-kwlang` but these are never set. As a result, the language of the highlighter always defaults to English regardless of the current language. This PR makes some minimal changes to address the issue.

Fixes #6112

**How to test**
As an anonymous user go to /hedy and change the language to Turkish (or any other language). In the editor paste `yazdır test` and check that the first word is highlighted as a command. Do the same check for the /tryit page and a logged in user.



Co-Authored-By: Rico Hermans <rix0rrr@gmail.com>
Co-Authored-By: rix0rrr <rix0rrr@users.noreply.github.com>
Co-Authored-By: Rico Huijbers <rix0rrr@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

2 participants