Last modified: 2009-12-31 03:02:15 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 T9488, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 7488 - Remove hardcoded 'zh-' reference in LanguageConverter.php
Remove hardcoded 'zh-' reference in LanguageConverter.php
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Language converter (Other open bugs)
1.8.x
All All
: Normal normal with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  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: ---


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

Description AlefZet 2006-10-04 13:36:40 UTC
In LanguageConverter.php in getPreferredVariant() function occured hardcoded 'zh-' reference (string 
117):
$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.


Navigation
Links