VisualEditor: RTL entries don't receive dir="rtl" in Page settings / Languages

We call isRedirect to get the real language code instead of the site code.
Post-factum, lang attribute is added as well for each entry.

Bug: 53503
Change-Id: Ia6bf63a7cbe3c7b99ed05d0bd0fdd33190550c98
This commit is contained in:
Pavel Selitskas 2013-08-29 01:26:02 +03:00
parent 8f7e9c27a7
commit 1084cdb350

View file

@ -142,10 +142,20 @@ ve.ui.MWMetaDialog.prototype.initialize = function () {
);
for ( i = 0; i < languageslength; i++ ) {
languages[i].safelang = languages[i].lang;
languages[i].dir = 'auto';
if ( $.uls ) {
// site codes don't always represent official language codes
// using real language code instead of a dummy ('redirect' in ULS' terminology)
languages[i].safelang = $.uls.data.isRedirect( languages[i].lang ) || languages[i].lang;
languages[i].dir = $.uls.data.getDir( languages[i].safelang );
}
$languagesTable
.append( this.frame.$$( '<tr>' )
.append( this.frame.$$( '<td>' ).append( languages[i].lang ) )
.append( this.frame.$$( '<td>' ).append( languages[i].title ) )
.append( this.frame.$$( '<td>' ).append( languages[i].title )
.attr( 'lang', languages[i].safelang )
.attr( 'dir', languages[i].dir ) )
);
}