Last modified: 2014-08-02 19:08:28 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 T17799, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 15799 - Using $wgConf to set the LanguageCode doesn't take care of directionality
Using $wgConf to set the LanguageCode doesn't take care of directionality
Status: NEW
Product: MediaWiki
Classification: Unclassified
Internationalization (Other open bugs)
All All
: Low enhancement with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
Depends on:
Blocks: rtl
  Show dependency treegraph
Reported: 2008-10-01 19:23 UTC by Huji
Modified: 2014-08-02 19:08 UTC (History)
9 users (show)

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


Description Huji 2008-10-01 19:23:54 UTC
In a wiki family, when these settings are used:

switch ($_SERVER["SERVER_NAME"])
	case "fa.localhost":
		$wgLanguageCode = "fa";
	case "en.localhost":
		$wgDBname           = "enwiki";

$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";
	case "en.localhost":
		$wgDBname           = "enwiki";
		$wgLanguageCode = "en";

the Persian wiki is correctly rendered RTL.

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