Page MenuHomePhabricator

Syntax Highlighting: Translated magic words aren't recognized in Hebrew
Open, MediumPublic5 Estimate Story Points

Description

From IKhitron:

Localized magic words are highlighted as templates. Example: {{DEFAULTSORT:AAA}} vs {{מיון רגיל:AAA}}.

The English version is dark red, the translated versions are purple.

You can see it here: https://he.wikipedia.beta.wmflabs.org/w/index.php?title=%D7%99%D7%A4%D7%94_%D7%AA%D7%95%D7%A1%D7%99%D7%94_%D7%9B%D7%94%D7%9F&action=edit

The list of localized parser functions, can be retrieved with mw.config.get('extCodeMirrorConfig'); (look in functionSynonyms[0] and functionSynonyms[1]).

Translated magic words work fine in German and Dutch. Probably an RTL issue.

Event Timeline

DannyH created this task.Jul 7 2017, 5:55 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJul 7 2017, 5:55 PM
DannyH triaged this task as Medium priority.Jul 7 2017, 5:55 PM
IKhitron added a subscriber: eranroz.
IKhitron added a subscriber: IKhitron.
Pastakhov closed this task as Invalid.Jul 10 2017, 2:52 AM
Pastakhov added a subscriber: Pastakhov.

This is the expected behavior.
Localized magic words should be highlighted only on local wiki.
As you see, MW parser interprets them as Template:SORTIERUNG:AA and Template:מיון רגיל:AAA

Feel free to reopen the ticket if it will not work on local wiki

How exactly can we check it on local wiki, @Pastakhov?

I meant that it depends on the value of the $wgLanguageCode variable.
On test.wikipedia.org it is en thus there are no Localized magic words.
For check localized magic words you should set $wgLanguageCode to corresponded value.

I found other way - add uselang parameter to url, but it is more a bag that a feature (and should be fixed)
For example https://test.wikipedia.org/w/index.php?title=Pride_and_Prejudice&action=edit&oldid=323245&uselang=de
Or change it by language toolbar at the top of page. But in this case I see only part of language aliases.
Have no idea why.

mxn added a subscriber: mxn.Jul 10 2017, 8:37 AM
IKhitron reopened this task as Open.Jul 10 2017, 9:35 AM

I opened the link you gave, @Pastakhov. It does not work indeed.

I found other way - add uselang parameter to url, but it is more a bag that a feature (and should be fixed)
For example https://test.wikipedia.org/w/index.php?title=Pride_and_Prejudice&action=edit&oldid=323245&uselang=de
Or change it by language toolbar at the top of page. But in this case I see only part of language aliases.
Have no idea why.

beaware that uselang usually (unless there is very special hook in test wiki) only changes the UI language, not the content language of the site.

Pastakhov added a comment.EditedJul 10 2017, 10:20 AM

@IKhitron, It does not work since there are only part of language aliases (localized magic words).
And as I wrote, I have no idea why there are only part of them.
In any case this behavior is a bug, CodeMirror should use only language from $wgLanguageCode and it will be fixed soon.
For check localized magic words you should set $wgLanguageCode to corresponded value or use the CodeMirror extension on wiki with $wgLanguageCode have corresponded value (it's no joke).

@eranroz, yes, uselang should change the UI language only, but one affects also to list of Magic Words used in CodeMirror. Not sure where the bug is, in MW Core or CodeMirror, hope the bug in CodeMirror and will be easily fixed.

P.S. created another task T170130

IKhitron added a comment.EditedJul 10 2017, 2:02 PM

You mean you actually expect I'll change the configuration of test.wikipedia.org?

@kaldari Is there a test wiki in any other language? It would help us to test that the magic words work properly on languages outside of English.

@kaldari Is there a test wiki in any other language? It would help us to test that the magic words work properly on languages outside of English.

We have the beta cluster which also has CodeMirror since I deployed it there. Here's the German version: https://de.wikipedia.beta.wmflabs.org/wiki/Wikipedia:Hauptseite I believe it needs a new account and doesn't work with CentralAuth. I could be wrong.

@IKhitron: I tried it out at https://de.wikipedia.beta.wmflabs.org/ and it seems to work correctly. "{{SORTIERUNG:AAA}}", the German localization for {{DEFAULTSORT}}, is correctly recognized as a magic word and highlighted as red instead of purple.

IKhitron closed this task as Invalid.Jul 10 2017, 8:41 PM

Thank you very much.

@kaldari, we have a problem. It does not work. See here. Thank you.

kaldari renamed this task from Syntax Highlighting: Translated magic words are treated like templates to Syntax Highlighting: Translated magic words aren't recognized in Hebrew.Jul 21 2017, 5:42 PM
kaldari reopened this task as Open.
kaldari updated the task description. (Show Details)

@IKhitron: I reopened and change the bug title and description.

kaldari set the point value for this task to 5.Jul 25 2017, 5:15 PM
DannyH updated the task description. (Show Details)Jul 25 2017, 7:22 PM

I checked to see if this was a problem on Dutch Beta -- it works correctly there, as in the screenshot below. This is probably an RTL issue.