Last modified: 2009-12-31 03:02:15 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 7488 - Remove hardcoded 'zh-' reference in LanguageConverter.php
Remove hardcoded 'zh-' reference in LanguageConverter.php
Product: MediaWiki
Classification: Unclassified
Language converter (Other open bugs)
All All
: Normal normal with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
Depends on:
  Show dependency treegraph
Reported: 2006-10-04 13:36 UTC by AlefZet
Modified: 2009-12-31 03:02 UTC (History)
0 users

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

Patch for LanguageConverter.php (830 bytes, patch)
2006-10-07 16:29 UTC, AlefZet

Description AlefZet 2006-10-04 13:36:40 UTC
In LanguageConverter.php in getPreferredVariant() function occured hardcoded 'zh-' reference (string 
$zh = strstr($header, 'zh-');

This is preventing use the code for other languages but zh

It should look like:
$zh = strstr($header, $mMainLanguageCode.'-');

where $mMainLanguageCode normally give LanguageXx from call like:
$this->mConverter = new KkConverter($this, 'kk', $variants, $variantfallbacks ); 

'kk' may changed to 'sr', 'zh' etc
Comment 1 AlefZet 2006-10-06 14:38:41 UTC
Above code sometimes does not work. Need trick showed bellow:

$zh = strstr($header, $pv.'-');
Comment 2 AlefZet 2006-10-07 16:29:25 UTC
Created attachment 2477 [details]
Patch for LanguageConverter.php
Comment 3 AlefZet 2006-11-06 20:33:56 UTC
Fixed in r17461

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