Closed Felienne closed 2 years ago
I'm not sure what would be the best approach, as the highlighting will work in Arabic if the user chosen Arabic as their keyword language on profile settings. The problem seems to be the hard-coded translated keywords in the Arabic YAMLs. When setting the keyword language to Arabic it works fine:
But I agree that this is confusing for the end-users. So reversing this will tackle the problem for know but is not really a solution. The best solution would be to update all YAMLs to make sure they use placeholders instead of hardcoded translated keywords. As currently the keywords won't be parsed either when using Arabic with English keywords as there are no placeholders to replace.
Thinking about it a bit more, what about this:
When switching to a language L, we do show the highlighting in En and L, but we only show the language switcher when people pick a default language in their profile?
Because I think we went on this path mainly because the switcher makes the UI a bit busier?
The best solution would be to update all YAMLs to make sure they use placeholders instead of hardcoded translated keywords.
This should be fixed in the mean time, so that part is addressed
I will hide the switcher when no keyword language is set on the profile and set the keyword language to the chosen language if this is non-latin. This still has some unwanted changes as all keywords will be parsed to the chose language in this case. So for example, Arabic users will never see the English keywords.
Ok, this is not really a bug, but a wrong decision previously made (in https://github.com/Felienne/hedy/pull/2357)
While it makes a lot of sense for Dutch not to highlight keywords by default, for Arabic (and Hindi, and Greek?) we do want to highlight the language itself because these languages are a lot less likely to use English keywords. The issue is also due to the level defaults in Arabic not using
{print}
, so we also immediately see the English keywords, and see them highlighted.Maybe we should have categories of languages, "English by default" for Latin languages, and "local by default" for non-latin? Or maybe the highlighter should just be better so there is no confusion (we are working on that)?
But for now, I think we should revert #2357 for Arabic? If those content files also use
{print}
, we have to see what the situation of the highlighter is then and how we want to approach things.