Page MenuHomePhabricator

Using $wgConf to set the LanguageCode doesn't take care of directionality
Open, LowPublic

Description

In a wiki family, when these settings are used:

switch ($_SERVER["SERVER_NAME"])
{
case "fa.localhost":

		$wgLanguageCode = "fa";
		break;

case "en.localhost":

		$wgDBname           = "enwiki";
		break;

}

$wgLocalDatabases = array( 'enwiki','fawiki' );
$wgConf->wikis = $wgLocalDatabases;
$wgConf->suffixex = array( 'wiki' );
$wgConf->localVHosts = array( 'localhost' );
list( $site, $lang ) = $wgConf->siteFromDB( $wgDBname );
$params = array( 'site' => $site, 'lang' => $lang, 'wiki' => $wgDBname );
$wgConf->settings = array(
'wgScriptPath' => array( 'default' => '/w' ),
'wgArticlPath' => array( 'default' => '/wiki/$1' ),
'wgSitename' => array( 'enwiki' => 'English Wiki', 'fawiki' => 'ویکی فارسی' ),
'wgLanguageCode' => array( '$lang' ),
'wgLocalInterwiki' => array( '$lang' ),
'wgSecretKey' => array(

		'enwiki' => "ce352ddd112c5d9665cf7264f2a6a36b91aebc2242fd2f4ffcbb5a4cd0601590",
		'fawiki' => "5985cc63dbb366e3837cde1868e2f2cfdd6ea0b77bf95510686bc1f1822e4e40",

),
);

Both the Persian and the English wikis are rendered left-to-right. However, when $wgLanguageCode is set in the top section:

switch ($_SERVER["SERVER_NAME"])
{
case "fa.localhost":

		$wgDBname           = "fawiki";
		$wgLanguageCode = "fa";
		break;

case "en.localhost":

		$wgDBname           = "enwiki";
		$wgLanguageCode = "en";
		break;

}

the Persian wiki is correctly rendered RTL.


Version: unspecified
Severity: enhancement

Details

Reference
bz15799

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 10:20 PM
bzimport set Reference to bz15799.
bzimport added a subscriber: Unknown Object (MLST).
Huji created this task.Oct 1 2008, 7:23 PM
Restricted Application added a project: I18n. · View Herald TranscriptJun 2 2015, 2:20 PM
Ebraminio moved this task from Backlog to MediaWiki-core on the RTL board.Aug 9 2015, 11:53 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 9 2015, 11:53 AM
Amire80 moved this task from Untriaged to RTL on the I18n board.Feb 27 2018, 8:03 AM