Last modified: 2013-05-10 18:16:03 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T35175, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 33175 - VisualEditor: Content in an LTR wiki is displayed RTL in CE block if the interface language is RTL
VisualEditor: Content in an LTR wiki is displayed RTL in CE block if the inte...
Status: RESOLVED FIXED
Product: VisualEditor
Classification: Unclassified
MediaWiki integration (Other open bugs)
unspecified
All All
: High normal
: VE-deploy-2013-05-13
Assigned To: Roan Kattouw
http://www.mediawiki.org/wiki/Special...
: i18n
Depends on:
Blocks: ve-rtl
  Show dependency treegraph
 
Reported: 2011-12-15 20:18 UTC by Amir E. Aharoni
Modified: 2013-05-10 18:16 UTC (History)
10 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Amir E. Aharoni 2011-12-15 20:18:35 UTC
The default direction for text in the Visual Editor should match the direction of the site. Currently it appears to match the direction of the user's content language.

This also affects all the help panes - JSON, preview, keyboard shortcuts help, etc.
Comment 1 Daniel Friesen 2011-12-15 23:09:31 UTC
Not necessarily the content direction. More like the page language direction fetched from Title.
Comment 2 Amir E. Aharoni 2011-12-16 00:56:21 UTC
Actually, the toolbar happens to be mostly OK and the toolbar should match the interface language. Some toolbar buttons must be adjusted for RTL, but that's a separate bug.
Comment 3 James Forrester 2012-06-22 20:51:53 UTC
Confirmed bug is still present in new version - CE takes language cue from uselang when should take it from the wiki (?). Note that toolbar/chrome issues also appear.
Comment 4 Robin Pepermans (SPQRobin) 2012-06-22 21:06:43 UTC
The direction should be taken from Title->getPageLanguage(), which in the case of the special page depends on the user language. But because that is also the case on mw:VisualEditor:Welcome, there is indeed a bug. Looking at the source, the <div class="mw-content-ltr/rtl"> is unused and instead a <div class="ve-surface"> is added. I think adding there the same attributes as on the other div will fix this bug.
Comment 5 James Forrester 2012-06-22 22:05:55 UTC
Mass-moving items into VisualEditor product
Comment 6 James Forrester 2012-06-23 01:36:14 UTC
Mass-move out of "General" to "ContentEditable".
Comment 7 Christian Williams 2012-07-23 21:31:20 UTC
Rob, it looks like this might be as easy as copying the lang and dir attributes from the #mw-content-text element and applying them to the .ve-surface element.
Comment 8 Christian Williams 2012-07-23 21:32:16 UTC
Switching to integration.
Comment 9 Amir E. Aharoni 2012-07-23 21:40:42 UTC
If you haven't already, take a look at
https://www.mediawiki.org/wiki/VisualEditor/Internationalization_requirements

It is supposed to give an idea about the general framework of how language is handled in MW.
Comment 10 Amir E. Aharoni 2012-07-23 21:42:01 UTC
... Sorry, saved before completing.

If you haven't already, take a look at
https://www.mediawiki.org/wiki/VisualEditor/Internationalization_requirements

It is supposed to give an idea about the general framework of how information about content language should be stored and used in MW in the VE age. It is up for discussion, of course.
Comment 11 Robin Pepermans (SPQRobin) 2012-07-23 22:23:32 UTC
(In reply to comment #7)
> Rob, it looks like this might be as easy as copying the lang and dir attributes
> from the #mw-content-text element and applying them to the .ve-surface element.

Yep, that's what I said in comment 4 :-)
Comment 12 Trevor Parscal 2012-08-22 21:03:01 UTC
The content direction issues were resolved in Iaf61fb9e8ad0ba3ab70ffa00c75da4c6f01aad61 by copying the dir and lang attributes from the #mw-content-text div to the document.

The toolbar issues should be reported separately and with greater detail.
Comment 13 Liangent 2012-09-04 16:22:00 UTC
(In reply to comment #12)
> The content direction issues were resolved in
> Iaf61fb9e8ad0ba3ab70ffa00c75da4c6f01aad61 by copying the dir and lang
> attributes from the #mw-content-text div to the document.
> 
> The toolbar issues should be reported separately and with greater detail.

With my Gerrit change #9860, the attribs of #mw-content-text don't always belong to $wgContLang now.
Comment 14 Liangent 2012-09-04 16:25:44 UTC
Reopening, the issue will still appear when someone visits [[kk:pagename]] with variant=kk-arab set where wikitext is written in kk-latn. (where kk and kk-latn is ltr and kk-arab is rtl).
Comment 15 James Forrester 2013-01-07 23:24:25 UTC
Assigning to current milestone, as it's been sitting around for four months untouched at this point.
Comment 16 Roan Kattouw 2013-03-22 21:03:03 UTC
(In reply to comment #14)
> Reopening, the issue will still appear when someone visits [[kk:pagename]]
> with
> variant=kk-arab set where wikitext is written in kk-latn. (where kk and
> kk-latn
> is ltr and kk-arab is rtl).
Yup, that's a bug. We need to use Title::getPageLanguage() instead of looking at #mw-content-text (which is controlled by getPageViewLanguage()).

However, MW core doesn't quite get this right either, see bug 46463.
Comment 17 James Forrester 2013-04-16 19:40:34 UTC
This didn't make it to the milestone; pushing back.
Comment 18 Krinkle 2013-04-22 17:16:18 UTC
(In reply to comment #12)
> The content direction issues were resolved in Iaf61fb9e8ad0ba
> by copying the dir and lang  attributes from the #mw-content-text
> div to the document.
> 
> The toolbar issues should be reported separately and with greater detail.

Can someone confirm that the edit surface in VisualEditor is now properly using the directionality of the wiki content language (instead of the user language)?

From what I can see this bug is fixed in that regard by change Iaf61fb9e8ad0ba indeed.

(In reply to comment #16)
> (In reply to comment #14)
> > Reopening, the issue will still appear when someone visits [[kk:pagename]]
> > with
> > variant=kk-arab set where wikitext is written in kk-latn. (where kk and
> > kk-latn
> > is ltr and kk-arab is rtl).
>
> Yup, that's a bug. We need to use Title::getPageLanguage() instead of looking
> at #mw-content-text (which is controlled by getPageViewLanguage()).
> 
> However, MW core doesn't quite get this right either, see bug 46463.

So there is a case where the #mw-content-text isn't set to the wiki content language but to the user language, if the content language has a variation? That sounds like a MediaWiki core bug perhaps. Though we could export Title::getPageLanguage() in VisualEditor specifically, looks like this should be fixed in core instead, given that it sounds like the regular view of an article when reading articles would be broken now as well. And I think the VisualEditor edit surface should match what the regular page view does.
Comment 19 Liangent 2013-04-23 04:39:42 UTC
(In reply to comment #18)
> So there is a case where the #mw-content-text isn't set to the wiki content
> language but to the user language, if the content language has a variation?
> That sounds like a MediaWiki core bug perhaps. Though we could export
> Title::getPageLanguage() in VisualEditor specifically, looks like this should
> be fixed in core instead, given that it sounds like the regular view of an
> article when reading articles would be broken now as well. And I think the
> VisualEditor edit surface should match what the regular page view does.

On wikis with variation, there're three language codes. One for user language (to fetch interface messages), another for content language (wikitext written in) and the third for page view language (after wikitext gets rendered, it's converted to another language / variant then displayed to user, by LanguageConverter). The third can be the same as or different from the first; they're used for different things. However in practice they're usually set to the same one by users but we shouldn't assume this. #mw-content-text has the third language code mentioned above, and if VisualEditor and Parsoid are not aware of variation / conversion, they're processing content in the first language (code).
Comment 20 Liangent 2013-04-23 04:40:42 UTC
(In reply to comment #19)
> (In reply to comment #18)
> > So there is a case where the #mw-content-text isn't set to the wiki content
> > language but to the user language, if the content language has a variation?
> > That sounds like a MediaWiki core bug perhaps. Though we could export
> > Title::getPageLanguage() in VisualEditor specifically, looks like this should
> > be fixed in core instead, given that it sounds like the regular view of an
> > article when reading articles would be broken now as well. And I think the
> > VisualEditor edit surface should match what the regular page view does.
> 
> On wikis with variation, there're three language codes. One for user language
> (to fetch interface messages), another for content language (wikitext written
> in) and the third for page view language (after wikitext gets rendered, it's
> converted to another language / variant then displayed to user, by
> LanguageConverter). The third can be the same as or different from the first;
> they're used for different things. However in practice they're usually set to
> the same one by users but we shouldn't assume this. #mw-content-text has the
> third language code mentioned above, and if VisualEditor and Parsoid are not
> aware of variation / conversion, they're processing content in the first
> language (code).

^ I guess this should be explained on some MW.org page. I have been asked about this stuff several times.
Comment 21 Liangent 2013-04-23 05:10:28 UTC
(In reply to comment #19)
> and if VisualEditor and Parsoid are not
> aware of variation / conversion, they're processing content in the first
> language (code).

Sorry I mean the second in this sentence.
Comment 22 James Forrester 2013-04-23 17:18:38 UTC
@Liangent: Some developer-focussed documentation of this area of MW would be wonderful - all I can find is about how it works for the user (and mostly from 2004).
Comment 23 Liangent 2013-04-24 08:31:50 UTC
(In reply to comment #22)
> @Liangent: Some developer-focussed documentation of this area of MW would be
> wonderful - all I can find is about how it works for the user (and mostly
> from
> 2004).

I updated https://www.mediawiki.org/w/index.php?title=Language_in_MediaWiki&diff=677107&oldid=599175 which is related to this bug... Actually the whole conversion system needs some re-design, though it doesn't have any timetable, but it still occurs to me that documenting the old stuff is not so worthwhile.
Comment 24 Gerrit Notification Bot 2013-05-10 18:05:17 UTC
Related URL: https://gerrit.wikimedia.org/r/63148 (Gerrit Change Ica006404227dcd286c387de4f637036341b17eae)
Comment 25 James Forrester 2013-05-10 18:16:03 UTC
Finally closed! Yay. (Merged, will go out in wmf4.)

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links