Index: trunk/tools/planet/zh/templates/index.html.tmpl |
— | — | @@ -18,7 +18,23 @@ |
19 | 19 | <link rel="stylesheet" href="planet.css" type="text/css">
|
20 | 20 | <TMPL_IF feedtype>
|
21 | 21 | <link rel="alternate" href="<TMPL_VAR feed ESCAPE="HTML">" title="<TMPL_VAR channel_title_plain ESCAPE="HTML">" type="application/<TMPL_VAR feedtype>+xml">
|
22 | | -</TMPL_IF>
|
| 22 | +</TMPL_IF> |
| 23 | +<script type="text/javascript"> |
| 24 | +<!-- |
| 25 | +function acceptlang(o) { |
| 26 | + var al = o.query.userinfo.acceptlang; |
| 27 | + for (var i = 0; i < al.length; i++) { |
| 28 | + var l = al[i].*.replace('_', '-').toLowerCase(); |
| 29 | + if ('zh-hans|zh-cn|zh-my|zh-sg'.indexOf(l)) { |
| 30 | + window.location.href = 'index.zh-hans.html'; |
| 31 | + } else if ('zh-hant|zh-hk|zh-mo|zh-tw'.indexOf(l)) { |
| 32 | + window.location.href = 'index.zh-hant.html'; |
| 33 | + } |
| 34 | + } |
| 35 | +} |
| 36 | +//--> |
| 37 | +</script> |
| 38 | +<script src="http://prototype.wikimedia.org/en-wp/api.php?action=query&meta=userinfo&uiprop=acceptlang&format=json&callback=acceptlang"></script>
|
23 | 39 | </head>
|
24 | 40 |
|
25 | 41 | <body> |