Language detection?
-
- Power Poster
- Posts: 300
- Joined: Tue Mar 04, 2008 10:37 am
Language detection?
Hey guys (especially Alby),
I was wondering; is there any way I can redirect the CMSms homepage to the detected browser language?
I tried doing this so, by using the HTTP_ACCEPT.. var (created a UDT with it, and used that UDT in the main page of the English part (Which is the default lang)). That works fine and all, but:
for example, when someone with a DUTCH browser language, wants to visit the ENGLISH home page, he/she is automatically redirected to the DUTCH part of the page. Is there any way I can work around that?
So to clearify: I want people that are new to the page, to be redirected to their mother tongue (according to their browser language), but afterwards be able to view the homepage in English as well.
Anyone?
I was wondering; is there any way I can redirect the CMSms homepage to the detected browser language?
I tried doing this so, by using the HTTP_ACCEPT.. var (created a UDT with it, and used that UDT in the main page of the English part (Which is the default lang)). That works fine and all, but:
for example, when someone with a DUTCH browser language, wants to visit the ENGLISH home page, he/she is automatically redirected to the DUTCH part of the page. Is there any way I can work around that?
So to clearify: I want people that are new to the page, to be redirected to their mother tongue (according to their browser language), but afterwards be able to view the homepage in English as well.
Anyone?
Re: Language detection?
Is already done.christiaans wrote: So to clearify: I want people that are new to the page, to be redirected to their mother tongue (according to their browser language), but afterwards be able to view the homepage in English as well.
Initial check is VS browser languages in same order of config_lang.php (put your primary language site on top of that array)
Alby
-
- Power Poster
- Posts: 300
- Joined: Tue Mar 04, 2008 10:37 am
Re: Language detection?
Okay, so if I understand correctly, it already does that check for me, it will automatically redirect people to their respective languages? If so, awesome.
-
- Power Poster
- Posts: 300
- Joined: Tue Mar 04, 2008 10:37 am
Re: Language detection?
I just tried it again, and IE does redirect me correctly, but Firefox just sends me to the standaard English frontpage, although my browserlanguage is definitely set to another language.
Is this a common firefox problem??
Is this a common firefox problem??
Re: Language detection?
No, depend from your browser language order (Tools > Options > Advanced > Languages) and your language order in config.phpchristiaans wrote: I just tried it again, and IE does redirect me correctly, but Firefox just sends me to the standaard English frontpage, although my browserlanguage is definitely set to another language.
Is this a common firefox problem??
Alby
-
- Power Poster
- Posts: 300
- Joined: Tue Mar 04, 2008 10:37 am
Re: Language detection?
Hmm, I'll look into it some more. Haven't got it work the way I want to yet.
Re: Language detection?
What are (in same order) your browser languages and in your config.php?christiaans wrote: Hmm, I'll look into it some more. Haven't got it work the way I want to yet.
Alby
-
- Power Poster
- Posts: 300
- Joined: Tue Mar 04, 2008 10:37 am
Re: Language detection?
Browser lang: Dutch - nl_NL
Config_lang.php: en, it, fr, nl, es, pl, de
Where default lang is en, and force default is turned off.
Hasn't worked for me so far (Firefox3), IE7 works like a charm
Config_lang.php: en, it, fr, nl, es, pl, de
Where default lang is en, and force default is turned off.
Hasn't worked for me so far (Firefox3), IE7 works like a charm
Re: Language detection?
christiaans wrote: Browser lang: Dutch - nl_NL
Config_lang.php: en, it, fr, nl, es, pl, de
Where default lang is en, and force default is turned off.
Hasn't worked for me so far (Firefox3), IE7 works like a charm
I suppose that your browser have en also
Try to move nl array in config.php before en
Alby
-
- Forum Members
- Posts: 33
- Joined: Thu Dec 11, 2008 11:41 pm
Re: Language detection?
Hi.
Have just installed the cmsmadesimple.
I have two languages installed: en_US and no_NO
Default lang is en_US
"Force initial DEFAULT_LANG" is unchecked in SiteAdmin->GlobalSettings
Can someone please explain to me how to make the site present correct language to client based on
the client's language settings.
Example: Firefox languages in order of preference are:
en-us
en-gb
en
no
Okay I close my firefox and enter:
http://localhost/cmsmadesimple/
Then it displays the Norwegian page.
Why does it not obey the language settings in Firefox which should then give priority to English?
Any suggestions
Have just installed the cmsmadesimple.
I have two languages installed: en_US and no_NO
Default lang is en_US
"Force initial DEFAULT_LANG" is unchecked in SiteAdmin->GlobalSettings
Can someone please explain to me how to make the site present correct language to client based on
the client's language settings.
Example: Firefox languages in order of preference are:
en-us
en-gb
en
no
Okay I close my firefox and enter:
http://localhost/cmsmadesimple/
Then it displays the Norwegian page.
Why does it not obey the language settings in Firefox which should then give priority to English?
Any suggestions
Re: Language detection?
MLE remember (for 1 day) last language used (with a cookie).bongobongo wrote: Why does it not obey the language settings in Firefox which should then give priority to English?
Change browser or clean your cookie for this site or wait tomorrow ....
Alby
-
- Forum Members
- Posts: 33
- Joined: Thu Dec 11, 2008 11:41 pm
Re: Language detection?
Thanks for that quick reply.
Looks like that fixed it.
Looks like that fixed it.
-
- Forum Members
- Posts: 33
- Joined: Thu Dec 11, 2008 11:41 pm
Re: Language detection?
Hmmm
Something weird is still going on:
In IE7 I do this:
If I only have Norwegian [no] in language preference and I delete browsing history (everything) then it
fetches the Norwegian pages from the site.
Now if I add [en-US] to the language preference, but after [no], it fetches the English pages from the site.
Why is that? Should it not obey that [no] is listed first?
If I then remove the [en-US] from the language preference and delete all browsing history then it fetches
my Norwegian pages again.....
This is confusing, any idea why I cannot have both [no] and [en-US] as described above and still
make it fetch my Norwegian pages?
Something weird is still going on:
In IE7 I do this:
If I only have Norwegian [no] in language preference and I delete browsing history (everything) then it
fetches the Norwegian pages from the site.
Now if I add [en-US] to the language preference, but after [no], it fetches the English pages from the site.
Why is that? Should it not obey that [no] is listed first?
If I then remove the [en-US] from the language preference and delete all browsing history then it fetches
my Norwegian pages again.....
This is confusing, any idea why I cannot have both [no] and [en-US] as described above and still
make it fetch my Norwegian pages?
Re: Language detection?
cookies not histories......bongobongo wrote: If I only have Norwegian [no] in language preference and I delete browsing history (everything) then it
fetches the Norwegian pages from the site.
Alby
-
- Forum Members
- Posts: 33
- Joined: Thu Dec 11, 2008 11:41 pm
Re: Language detection?
I'm actually hitting (in IE7), the "Delete all"l button which
then deletes:
Temporary Internet Files
Cookies
History
Form data
Passwords
Should not be much left to delete
Please re-read my previous post?
then deletes:
Temporary Internet Files
Cookies
History
Form data
Passwords
Should not be much left to delete

Please re-read my previous post?