Page MenuHomePhabricator

Enabling RTL direction for languages with LTR and RTL script variantes
Closed, ResolvedPublic

Description

Author: alefzet

Description:
For kk-cn being Arabic script need RTL direction


Version: unspecified
Severity: normal

Details

Reference
bz6756

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:18 PM
bzimport set Reference to bz6756.
bzimport added a subscriber: Unknown Object (MLST).

alefzet wrote:

It is not affected for multi-variant wiki. direction always is 'LTR'. Setting $rtl = true; in
doughter MessagesKk_cn file ignored by MediaWiki.

rotemliss wrote:

It's probably the problem of Bug 6100.

*** This bug has been marked as a duplicate of 6100 ***

alefzet wrote:

This bug isn't duplicate 6100.
Try do following: install wiki with ltr/rtl script variants (currently it is 'kk' only). After that
click to قازاق tab. Interface and content will switched to 'kk-cn' (Arabic script), but the
direction still left-to-right.
I think: probably MediaWiki does not read setting $rtl = true; from MessagesKk_cn.php, and try read
from main messages file MessagesKk.php only.
Direction should be RTL when switched to 'kk-cn'. The variable $rtl should be readed 1) from
current messages file (current variant), 2) if $rtl is not in this file, read from main messages
file, and 3) default messages file (en).

Bellow is temporary quick&dirty Javascript workaround for this issue:

if (wgUserLanguage == "kk-cn")
{

document.write('<link rel="stylesheet" type="text/css"

href="'+stylepath+'/common/common_rtl.css">');

document.write('<link rel="stylesheet" type="text/css" href="'+stylepath+'/'+skin+'/rtl.css">');

}

(Place this statements to MediaWiki:<skin_name>.js)

alefzet wrote:

(In reply to comment #4)
Forgot 'html {direction: rtl;}', so JavaScript should be:
if (wgUserLanguage == "kk-cn")
{

document.direction="rtl";
document.write('<style type="text/css">html {direction: rtl;}</style>');
document.write('<link rel="stylesheet" type="text/css"

href="'+stylepath+'/common/common_rtl.css">');

document.write('<link rel="stylesheet" type="text/css" href="'+stylepath+'/monobook/rtl.css">');

}
And only place is monobook.js (other skins does not work).

rotemliss wrote:

MediaWiki has two languages: interface language and content language. The
interface language is the langauge which the user selects: in preference, in
uselang, *or as a variant*. Most messages are used from this language. The
content language is used to get the namespaces and all the other things which
depend on the language of the content. Now, also the page direction is used from
the content language, though it should be used from the interface language.
That's Bug 6100. Here, the interface language is the variant ($wgLang - e.g.
kk-cn), and the content language is the main language ($wgContLang - kk). The
direction is read from the content language (kk), not from the interface
language (kk-cn), and that's the exact problem. If the software reads the
direction from the interface language, it also reads the variant direction, and
therefore it is RTL when using kk-cn. It doesn't for now, but if Bug 6100 will
be fixed, it will.

Remarking as a duplicate.

*** This bug has been marked as a duplicate of 6100 ***