Proposed code changes for the OutputPage.php

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Proposed code changes for the OutputPage.php

Shinjiman Ho
Hi all,

I am a new comer for contributing the code for MediaWiki.

(don't mind if my English is not good enough)
I am having a proposed changes for the function headElement() function,
which accepts various language while in different language code. The main
propose of this changes is to display the correct language/font correctly.
This problem is already exists in the Chinese wikis, which the language is
in Chinese, however the browsers (at least IE and Firefox browsers) are
detected as a Simplified Chinese webpage.

The problem have been discussed in its local Wikipedia pages:
http://zh.wikipedia.org/wiki/Wikipedia:%E4%BA%92%E5%8A%A9%E5%AE%A2%E6%A0%88/%E6%8A%80%E6%9C%AF/%E5%AD%98%E6%A1%A3/2005%E5%B9%B412%E6%9C%88#.E7.B9.81.E9.AB.94.E7.B6.B2.E9.A0.81.E8.83.BD.E5.90.A6.E6.94.B9.E6.88.90.E6.96.B0.E7.B4.B0.E6.98.8E.E9.AB.94.EF.BC.9F

http://zh.wikipedia.org/wiki/Wikipedia:%E7%B9%81%E7%AE%80%E4%BD%93%E8%BD%AC%E6%8D%A2%E8%AF%B7%E6%B1%82#-.7Btw:.E8.A7.92_.3D_hk:.E8.A7.92_.E2.89.A0_cn:.EF.A0.B3.7D-

http://zh.wikipedia.org/wiki/Wikipedia:%E4%BA%92%E5%8A%A9%E5%AE%A2%E6%A0%88/%E6%8A%80%E6%9C%AF#.E6.9C.89.E9.97.9C.E4.B8.AD.E6.96.87.E7.B6.AD.E5.9F.BA.E7.9A.84.E5.AD.97.E9.AB.94.E9.A1.AF.E7.A4.BA.E5.95.8F.E9.A1.8C

(All these webpages are from Chinese Wikipedia, in Chinese language)
And according to those pages, the users generally have a consensus to having
a change of display the language/font when it's in Traditional Chinese.

The display language has been tested under Internet Explorer and Firefox,
the results have been shown below:

Key:
IE = Internet Explorer
FF = Mozilla Firefox
SC = Simplified Chinese
TC = Traditional Chinese
TC-HKSCS = Traditional Chinese (Hong Kong Suppmelmentary Character Set
! = There's some problem when displaying the language of the webpage, the
language is incorrect

zh: SC(IE), SC(FF)
zh-hant: TC(IE), TC(FF)
zh-hans: TC(IE)!, SC(FF)
zh-cn: SC(IE), SC(FF)
zh-tw: TC(IE), TC(FF)
zh-hk: SC(IE)!, TC-HKSCS(FF)
zh-mo: SC(IE)!, SC(FF)!
zh-sg: SC(IE), SC(FF)

however, the Internet Explorer browser does not perfectly supporting the
zh-hans and zh-hant tags respectively. So to fix this language/font problem,
we need a several PHP scripts to display that properly. the steps are
indicated below:

1. Detects if a user is logged on or not, if so do the display language-code
check against the language value in user perferences;
2. If the user is not logged on, do the display language-code check against
the HTTP_ACCEPT_LANGUAGE value;
3. If the browser does not support the HTTP_ACCEPT_LANGUAGE (for very old
browser only). Automatically fallback to global language.

For display language code checking:
1. Detect is that a non zh-cn ot zh-tw installation, if so return the global
language;
2. Do the match for the language against several language-codes, if matches
return the display language code;
3. When none of them above matches, then automatically fallback to the
global language.

(this part of code can also performed besides the Chinese language)

For solving this problem, I've wrote a piece of code to there, however,
there's no idea which file are better inserting these pieces of code, or in
a seprate file. After I have had suggestions from here, I will put my code
into Bugzilla to do the checkout of my piece of code.

thanks :)

Shinjiman

--
http://meta.wikimedia.org/User:Shinjiman
http://en.wikipedia.org/User:Shinjiman
_______________________________________________
Wikitech-l mailing list
[hidden email]
http://mail.wikipedia.org/mailman/listinfo/wikitech-l