r68669 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r68668‎ | r68669 | r68670 >
Date:17:46, 28 June 2010
Author:liangent
Status:ok
Tags:
Comment:
Fixes of the auto language selection
Modified paths:
  • /trunk/tools/planet/zh/templates/index.html.tmpl (modified) (history)

Diff [purge]

Index: trunk/tools/planet/zh/templates/index.html.tmpl
@@ -25,10 +25,12 @@
2626 var al = o.query.userinfo.acceptlang;
2727 for (var i = 0; i < al.length; i++) {
2828 var l = al[i].*.replace('_', '-').toLowerCase();
29 - if ('zh-hans|zh-cn|zh-my|zh-sg'.indexOf(l)) {
 29+ if ('zh-hans|zh-cn|zh-my|zh-sg'.indexOf(l) != -1) {
3030 window.location.href = 'index.zh-hans.html';
31 - } else if ('zh-hant|zh-hk|zh-mo|zh-tw'.indexOf(l)) {
 31+ break;
 32+ } else if ('zh-hant|zh-hk|zh-mo|zh-tw'.indexOf(l) != -1) {
3233 window.location.href = 'index.zh-hant.html';
 34+ break;
3335 }
3436 }
3537 }

Status & tagging log