| |
| | |

CodersClub

 Forgot password?
 Register
Search
View: 6771|Reply: 8
Collapse the left

Lang switcher does not work

[Copy link]

 Russia

Post time: 2012-02-03 07:36
| Show all posts |Read mode
fengshui-123 reported an interesting bug in a new X2ML installation:
http://www.discuz.net/forum.php? ... ;page=7#pid23144608

Thanks Vot.

I have done the changes you suggested but still the same: blank page whenever I change the language.

I use FireFox and IE8, both show the same thing(blank), but I have no problem for yout test site: http://codersclub.org/discuzx/forum.php
One thing big different I notice, for your test site whenever I change langnguage the site address always show the same address:http://codersclub.org/discuzx/forum.php.
But for my site, it show different address, for examples:
http://localhost/dx2world/forum.php?language=en
http://localhost/dx2world/forum.php?language=zh
http://localhost/dx2world/forum.php?language=de


my discuz_version.php file attached below.
Actually my version of discuz is downloaded from your google code site.

 Russia

 Author| Post time: 2012-02-03 07:41
| Show all posts
I think, the problem may occure because of this possible reasons:

1) Very high security level in a browser
2) Browser used it's local cache instead of reloading a page (It is usual IE problem)
3) Syntax error in language files.
Post time: 2012-02-03 15:50
| Show all posts
vot replied at 2012-2-3 08:41
I think, the problem may occure because of this possible reasons:

1) Very high security level in a  ...

Thanks Vot.

I use the same browser on your site without problem.
I also downloaded and installed the international version of discuz.

maybe xampp server installed on my windows-xp pc got problem, so I will try to install on an internet web hosting  site to see whether the problem still exist or not. will report the case later.

 Russia

 Author| Post time: 2012-02-03 16:50
| Show all posts
fengshui-123,
when you are using FireFox, try the next:
1) Download and install this FF extension: http://livehttpheaders.mozdev.org/
2) Load your X2 in browser
3) Open the Live HttpHeaders in a separate window, clean the window content
4) Try to change language in X2
5) See what happens in the http-headers window!
Post time: 2012-02-04 04:05
| Show all posts
vot replied at 2012-2-3 17:50
fengshui-123,
when you are using FireFox, try the next:
1) Download and install this FF extension: h ...

Hi Vot,

Still the same: blank
below I attach the LiveHTTPHeader when I change language:

  1. http://localhost/dx2world/forum.php?language=en

  2. GET /dx2world/forum.php?language=en HTTP/1.1
  3. Host: localhost
  4. User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:9.0.1) Gecko/20100101 Firefox/9.0.1
  5. Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
  6. Accept-Language: zh-cn,zh;q=0.9,ar;q=0.8,fr;q=0.7,en;q=0.7,de;q=0.6,ru;q=0.5,zh-tw;q=0.4,th;q=0.3,es;q=0.2,ja;q=0.2,vi;q=0.1
  7. Accept-Encoding: gzip, deflate
  8. Accept-Charset: GB2312,utf-8;q=0.7,*;q=0.7
  9. Connection: keep-alive
  10. Referer: http://localhost/dx2world/forum.php

  11. HTTP/1.1 200 OK
  12. Date: Sat, 04 Feb 2012 01:00:31 GMT
  13. Server: Apache/2.2.11 (Win32) DAV/2 mod_ssl/2.2.11 OpenSSL/0.9.8i PHP/5.2.9
  14. X-Powered-By: PHP/5.2.9
  15. Content-Length: 3
  16. Keep-Alive: timeout=5, max=100
  17. Connection: Keep-Alive
  18. Content-Type: text/html
  19. X-Pad: avoid browser bug
  20. ----------------------------------------------------------
Copy the Code



Post time: 2012-02-04 10:10
| Show all posts
Edited by fengshui-123 at 2012-2-4 11:12

Hi Vot,

I found the problem!
The installation program generated ANSI encoding config_global.php.
And when I cut and paste the config_global.php code into the config_global_default.php (which is in UTF-8) and then I saved it as config_global.php which is now in UTF-8!.

After converting it to ANSI, now it work!  Another word, UTF-8 encoding's config_global.php does not work on my xampp webserver?

 Russia

 Author| Post time: 2012-02-04 10:33
| Show all posts
below I attach the LiveHTTPHeader when I change language:

I see a problem here:
There is NO the second redirection, again to "http://localhost/dx2world/forum.php".

I found the problem!
The installation program generated ANSI encoding config_global.php.

You are wrong.
The installation program do nothing with a encoding!
But the problem is here:
when I cut and paste the config_global.php code into the config_global_default.php

It is your editor changed the encoding!!!
Recommendations:
1) Use only editor that supports UTF-8 (i.e. Notepad++).
2) Force "UTF-8 without BOM" encoding before viewing/editing!
3) Remove all the BOM (it is UTF-8 starting tag) from any file (if encountered).

Post time: 2012-02-04 13:33
| Show all posts
Hi Vot, Thank you very much.
Post time: 2012-02-06 09:33
| Show all posts
Edited by fengshui-123 at 2012-2-6 10:34

After going through the series of replies here I think it is better to sum up what cause my problem below:

The blank page is caused by cutting portion of code from UTF-8 config_global_default.php file and paste it in ANSI config_global.php file.

To avoid the problem, I first convert the UTF-8 file to ANSI file, then cut and paste the code between the files.  Or you can also convert the ANSI file to UTF-8 file, then cut and paste between the files.

NotePad++ editor has a function to convert file to some common encodings.

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-05-28 20:23 GMT+3 , Processed in 0.081308 sec., 9 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