Last modified: 2014-05-27 19:49:32 UTC
When VisualEditor inserts an image, the thumbnail keywords are written in English: "File:", "thumb", "right" (but see Bug 51851). This should not, theoretically, be a problem, because the VisualEditor is supposed to make these keywords unimportant and hidden from the end-user. However, while the source editor is still being widely used, this is a problem, especially for right to left languages: it is very hard to edit these English keywords when they are mixed with right-to-left text. These keywords should be inserted in the language of the wiki.
In most ltr wikis the English version is actually the most commonly used today, which is why we went with serializing new content with the English defaults. This is not ideal for rtl languages though, as this leads to a mix of ltr and rtl text. If you can provide us with a list of rtl language codes and check for each if a common offset in the option aliases is a good default, then we can add a list of rtl languages to the serializer and use the localized defaults for those.
We don't actually need to hard-code the list of rtl wikis, as that information is available in the site info returned by the API. It would still be good to check for each current rtl wiki if the first option alias is always a good one.
For the site info, look for "rtl" in http://he.wikipedia.org/w/api.php?action=query&meta=siteinfo&siprop=general&format=json
I went over the RTL languages and samples practical Wikipedia articles, and it seems that the first alias is always is always the most frequently used. Is there anything I can do to help move this forward? It's one of the most requested features.
I'm pretty sure our magic words support already has the appropriate localized keyword alias. We just aren't using it (yet).
Change 103082 had a related patch set uploaded by Cscott: Edited image attributes should override data-parsoid value. https://gerrit.wikimedia.org/r/103082
The above was merged in January, but this bug isn't fixed AFAICT. Also, we should probably use the local wikitext over the English version in all languages, not just RTL ones.
Yes, that is correct. The patch was merged and then the language-specific parts were reverted because the way it selected the aliases was fragile in LTR languages. This is still on my to-do list for a proper fix; IIRC the blocking issue is we need to export a simple RTL/LTR flag in siteinfo.
(In reply to C. Scott Ananian from comment #8) > Yes, that is correct. The patch was merged and then the language-specific > parts were reverted because the way it selected the aliases was fragile in > LTR languages. This is still on my to-do list for a proper fix; IIRC the > blocking issue is we need to export a simple RTL/LTR flag in siteinfo. Would it be easier if we just had Parsoid default to the (first?) localised string over the generic wikitext? This presumably doesn't need any MW API changes…