| |
| | |

CodersClub

 Forgot password?
 Register
Search
View: 4763|Reply: 4
Collapse the left

detect_language function

[Copy link]

 Taiwan

Post time: 2012-01-17 04:54
| Show all posts |Read mode
本帖最後由 ken 於 2012-1-17 05:55 編輯

about function detect_language in source/function/function_core.php
if browser HTTP_ACCEPT_LANGUAGE = Traditional Chinese , automatic selection Simplified Chinese.

rev.311
file source/function/function_core.php   line 498
  1. $choice = strtolower(substr($value,0,2));
Copy the Code
changed


  1. if(($value=='zh-tw')||($value=='zh-hk')){
  2. $choice = 'tc';
  3. }else{
  4. $choice = strtolower(substr($value,0,2));
  5. }
Copy the Code



 Russia

Post time: 2012-01-17 08:11
| Show all posts

 Taiwan

 Author| Post time: 2012-01-21 18:37
| Show all posts
本帖最后由 ken 于 2012-1-21 19:41 编辑

Sorry~
This fix code have a error!
  1. if(($value=='zh-tw')||($value=='zh-hk')){
Copy the Code
Should be
  1. if((strtolower($value)=='zh-tw')||(strtolower($value)=='zh-hk')){
Copy the Code
IE9, Chrome will show 'zh-TW'

 Russia

Post time: 2012-01-21 19:04
| Show all posts
Thanx!
I've changed the code slightly:
  1.                         // zh-tw/zh-hk patch by ken
  2.                         $value = strtolower($value);
  3.                         if(($value=='zh-tw')||($value=='zh-hk')){
  4.                                 $choice = 'tc';
  5.                         } else {
  6.                                 $choice = substr($value,0,2);
  7.                         }
Copy the Code

 Russia

Post time: 2012-01-21 19:07
| Show all posts
You have to log in before you can reply Login | Register

Points Rules

Archive|Mobile|Dark room|CodersClub

Top.Mail.Ru
Top.Mail.Ru

2024-11-22 05:04 GMT+3 , Processed in 0.052288 sec., 8 queries .

Powered by Discuz! X3.4 Release 20230520

© 2001-2024 Discuz! Team.

MultiLingual version, Rev. 4301, © codersclub.org

Quick Reply To Top Return to the list