Detection of browser language setting not working?
Moderator: General Support Moderators
Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
-
- Joomla! Apprentice
- Posts: 20
- Joined: Thu Feb 03, 2011 3:21 pm
Detection of browser language setting not working?
I've followed the Language Switcher Tutorial for Joomla 1.6 but I've hit a wall when trying to enable the detection of browser language setting on first visit.
Both plug-in and module are enabled as per the tutorial. In the System - Language Filter settings, I've set Language Selection for new Visitors to Browser Settings. I can switch language by clicking on the Language Switcher flags and land on the intended home page for the corresponding language. So far, so good.
On first visit, though, I always land on the page for the default language as set in the Language Manager, irrespective of browser settings. I've been careful to do these test with emptied cache and no cookie stored. I've tried with FFX and IE, many browser settings, to no avail. HTTP header Accept Language seems to be utterly ignored.
Also, it looks like the Language Filter doesn't [* spam *] out pages in other languages in the navigation. Is this why the tutorial recommend to put articles in languages specific categories? Looks to me that with SEF enabled, this will result in strange looking URLs like /en/en-GB/...
So, has anyone succesfully used browser settings language detection in 1.6?
Is there a bug in navigation filtering?
What could I check in my settings if this look like some misconfiguration on my side?
Both plug-in and module are enabled as per the tutorial. In the System - Language Filter settings, I've set Language Selection for new Visitors to Browser Settings. I can switch language by clicking on the Language Switcher flags and land on the intended home page for the corresponding language. So far, so good.
On first visit, though, I always land on the page for the default language as set in the Language Manager, irrespective of browser settings. I've been careful to do these test with emptied cache and no cookie stored. I've tried with FFX and IE, many browser settings, to no avail. HTTP header Accept Language seems to be utterly ignored.
Also, it looks like the Language Filter doesn't [* spam *] out pages in other languages in the navigation. Is this why the tutorial recommend to put articles in languages specific categories? Looks to me that with SEF enabled, this will result in strange looking URLs like /en/en-GB/...
So, has anyone succesfully used browser settings language detection in 1.6?
Is there a bug in navigation filtering?
What could I check in my settings if this look like some misconfiguration on my side?
-
- Joomla! Fledgling
- Posts: 2
- Joined: Fri Feb 04, 2011 9:50 pm
Re: Detection of browser language setting not working?
I too have this problem
My system's version are:
Apache/2.2.14
PHP/5.3.1
mod_perl/2.0.4
Perl/v5.10.1
My system's version are:
Apache/2.2.14
PHP/5.3.1
mod_perl/2.0.4
Perl/v5.10.1
- infograf768
- Joomla! Master
- Posts: 19133
- Joined: Fri Aug 12, 2005 3:47 pm
- Location: **Translation Matters**
Re: Detection of browser language setting not working?
I confirm. Will create a tracker.AntonAkola wrote: So, has anyone succesfully used browser settings language detection in 1.6?
I do not understand what you mean here.Is there a bug in navigation filtering?
Could you give an example?
Jean-Marie Simonet / infograf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group
-
- Joomla! Apprentice
- Posts: 20
- Joined: Thu Feb 03, 2011 3:21 pm
Re: Detection of browser language setting not working?
Thanks for that. Could you point me to that tracker?infograf768 wrote:I confirm. Will create a tracker.
Quite simply that the page (article) navigation doesn't filter out articles in other languages than the one selected.infograf768 wrote:I do not understand what you mean here. Could you give an example?Is there a bug in navigation filtering?
For instance, a menu module tagged with aa-AAA won't be displayed on the front-end if I select en-GB using the Language Switcher. Similarly, a menu module tagged with language All will be displayed, but not its menu options which language tags don't match the selected language. (That's handy by the way as it allows one to set-up and manage all languages with only one menu/menu module, and then for instance change the menu position in one operation for all languages.)
But in the case of the navigation buttons [< Prev] and [Next >], the navigation goes through all pages in the category (or all uncategorized articles), regardless of language. One would naturally expect that only pages tagged with current selected language would show in the navigation.
On the same topic, I find it a bit confusing that the articles order in the navigation start from the last article through to the first, in reverse order from the order set up in the Article Manager. But that may be a feature, not a bug?
- infograf768
- Joomla! Master
- Posts: 19133
- Joined: Fri Aug 12, 2005 3:47 pm
- Location: **Translation Matters**
Re: Detection of browser language setting not working?
http://joomlacode.org/gf/project/joomla ... m_id=24767Thanks for that. Could you point me to that tracker?
One should not set items in one specific category to different languages.But in the case of the navigation buttons [< Prev] and [Next >], the navigation goes through all pages in the category (or all uncategorized articles), regardless of language. One would naturally expect that only pages tagged with current selected language would show in the navigation.
It is strongly advised for correct implementation to separate all for each language.
If you need to display in different content languages identical contents, just copy/move them to the other language specific category.
Also, the uncategorized category is present in 1.6 to deal with legacy 1.5 (and its section/category structure).
Forget it or get rid of it if you start a 1.6 site from scratch.
Jean-Marie Simonet / infograf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group
-
- Joomla! Apprentice
- Posts: 20
- Joined: Thu Feb 03, 2011 3:21 pm
Re: Detection of browser language setting not working?
Thanks again.infograf768 wrote:http://joomlacode.org/gf/project/joomla ... m_id=24767Could you point me to that tracker?
Thanks for the clarification. One will keep that in mind. Rules have to be enforced or...infograf768 wrote:One should not set items in one specific category to different languages. It is strongly advised for correct implementation to separate all for each language.
Too bad we have to do that AND tag articles with languages though.
Looks like this reverse order navigation will not be that useful anyway, unless I get to override that in my template. Back to that then.
-
- Joomla! Fledgling
- Posts: 2
- Joined: Fri Feb 04, 2011 9:50 pm
Re: Detection of browser language setting not working?
Excuse me if I write in this topic also my problem. As a guide, I've enabled the form "System - Language Filter", the menu page, as all have as their language: "All". I have created in the "Language Manager" the content it-IT and its front-end language. The automatic switching of language, I do not work. I did a debug code. In the processing of the function app-> route () in index.php. it is in the function __destruct () debug.php file, and executing the command "return" the following code:
if (!JDEBUG) {
return;
}
compile your code back to the index.php page reloading the entire site by disabling the active functions:
detect_browser 0
automatic_change 0
sorry for my horrible English
if (!JDEBUG) {
return;
}
compile your code back to the index.php page reloading the entire site by disabling the active functions:
detect_browser 0
automatic_change 0
sorry for my horrible English
- infograf768
- Joomla! Master
- Posts: 19133
- Joined: Fri Aug 12, 2005 3:47 pm
- Location: **Translation Matters**
Re: Detection of browser language setting not working?
The browser detection and switch depending on user language (cookies) has been corrected in trunk
It will be available in 1.6.1
It will be available in 1.6.1
Jean-Marie Simonet / infograf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group
- jojo7
- Joomla! Apprentice
- Posts: 22
- Joined: Thu Apr 12, 2012 11:00 pm
- Location: München
- Contact:
Re: Detection of browser language setting not working?
Hello,
language selection by browser language setting
stoped working after update joomla! 2.5.3->2.5.4. on local install using firefox 11.0
(and on the multilingual demo site?
http://multilingual.demojoomla.com - though not shure, if it is set to do so).
Can anybody reproduce/confirm this, or am I missing something?
thanks and greetings, chris
language selection by browser language setting
stoped working after update joomla! 2.5.3->2.5.4. on local install using firefox 11.0
(and on the multilingual demo site?
http://multilingual.demojoomla.com - though not shure, if it is set to do so).
Can anybody reproduce/confirm this, or am I missing something?
thanks and greetings, chris
-
- Joomla! Apprentice
- Posts: 20
- Joined: Thu Feb 03, 2011 3:21 pm
Re: Detection of browser language setting not working?
There was indeed some changes in multilanguage functionalities with this version but everything is still working as it should for me after the update (you might want to check up this new setting anyway).jojo7 wrote:language selection by browser language setting stopped working after update joomla! 2.5.3->2.5.4. on local install using firefox 11.0
Other than that, I have no idea what your problem might be.
As a side note, the browser used should make no difference whatsoever on this functionality, provided that its setup is really what you need for your tests (double check that, maybe).
- infograf768
- Joomla! Master
- Posts: 19133
- Joined: Fri Aug 12, 2005 3:47 pm
- Location: **Translation Matters**
Re: Detection of browser language setting not working?
Using lang selection by browser language settings may work ONLY for the first time the site displays.jojo7 wrote:Hello,
language selection by browser language setting
stoped working after update joomla! 2.5.3->2.5.4. on local install using firefox 11.0
(and on the multilingual demo site?
http://multilingual.demojoomla.com - though not shure, if it is set to do so).
Can anybody reproduce/confirm this, or am I missing something?
thanks and greetings, chris
Thereafter, as a cookie is set, it is the last content language used that will display.
Jean-Marie Simonet / infograf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group
-
- Joomla! Apprentice
- Posts: 20
- Joined: Thu Feb 03, 2011 3:21 pm
Re: Detection of browser language setting not working?
Good point. I forgot to mention this as the most probable cause. It might be a good idea to set Firefox in Private browsing mode to do language selection tests, if removing cookies or setting up automatic cache emptying (and cookie removal) is too much of a hassle.infograf768 wrote:Using lang selection by browser language settings may work ONLY for the first time the site displays. Thereafter, as a cookie is set, it is the last content language used that will display.
- jojo7
- Joomla! Apprentice
- Posts: 22
- Joined: Thu Apr 12, 2012 11:00 pm
- Location: München
- Contact:
Re: Detection of browser language setting not working?
hi, thanks for your replys, did some testing (IE8+FF11 and cookies deleted everytime) :
win xp, new xampp, new local install j2.5.4, two languages:
language by browser setting stopps working when SEO is turned on, ok when off,
no problem with j2.5.3 - works perfekt with SEO!
any ideas, maybe cookie path settings (left fields blank on both versions), or a bug?
multilanguage-demo-site allways starts english for me (cookies deleted, browser set to german) - is that normal/wanted behavior? hm, if not, do you see another language on start (cookies deleted, browser set to one of the other installed languages-not english)? (I can see in BE it's 2.5.4, but can't access the System-Language-Filter-plugin, so I don't know the settings (would be nice though))
found related post by akasht, Sat Apr 07:
http://forum.joomla.org/viewtopic.php?p ... 8#p2782978
any hint/help is welcome, thanks for taking some time
win xp, new xampp, new local install j2.5.4, two languages:
language by browser setting stopps working when SEO is turned on, ok when off,
no problem with j2.5.3 - works perfekt with SEO!
any ideas, maybe cookie path settings (left fields blank on both versions), or a bug?
multilanguage-demo-site allways starts english for me (cookies deleted, browser set to german) - is that normal/wanted behavior? hm, if not, do you see another language on start (cookies deleted, browser set to one of the other installed languages-not english)? (I can see in BE it's 2.5.4, but can't access the System-Language-Filter-plugin, so I don't know the settings (would be nice though))
found related post by akasht, Sat Apr 07:
http://forum.joomla.org/viewtopic.php?p ... 8#p2782978
any hint/help is welcome, thanks for taking some time
- infograf768
- Joomla! Master
- Posts: 19133
- Joined: Fri Aug 12, 2005 3:47 pm
- Location: **Translation Matters**
Re: Detection of browser language setting not working?
It looks like this issue is due to the setting: Remove URL Language Code (for the default site language) in the languagefilter plugin.
Looking into this.
Looking into this.
Jean-Marie Simonet / infograf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group
- jojo7
- Joomla! Apprentice
- Posts: 22
- Joined: Thu Apr 12, 2012 11:00 pm
- Location: München
- Contact:
Re: Detection of browser language setting not working?
great, it works with 'Remove URL Language Code' turned off and SEO on, thank you so much!
- infograf768
- Joomla! Master
- Posts: 19133
- Joined: Fri Aug 12, 2005 3:47 pm
- Location: **Translation Matters**
Re: Detection of browser language setting not working?
It is a bug though that was introduced in
http://joomlacode.org/gf/project/joomla ... m_id=28151
Please test this replacement file:
{new file below}
Decompress and replace plugins/system/languagefilter/languagefilter.php
Test again with URL Language Code set to Yes (after clearing Cookies)
Tracker open:
http://joomlacode.org/gf/project/joomla ... m_id=28407
If this works for you, please comment on tracker.
http://joomlacode.org/gf/project/joomla ... m_id=28151
Please test this replacement file:
{new file below}
Decompress and replace plugins/system/languagefilter/languagefilter.php
Test again with URL Language Code set to Yes (after clearing Cookies)
Tracker open:
http://joomlacode.org/gf/project/joomla ... m_id=28407
If this works for you, please comment on tracker.
Jean-Marie Simonet / infograf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group
- jojo7
- Joomla! Apprentice
- Posts: 22
- Joined: Thu Apr 12, 2012 11:00 pm
- Location: München
- Contact:
Re: Detection of browser language setting not working?
still same behavior,
even with cookies not cleared, when i start the site in a new tab, it starts with default language (with URL Language Code set to Yes).
even with cookies not cleared, when i start the site in a new tab, it starts with default language (with URL Language Code set to Yes).
-
- Joomla! Enthusiast
- Posts: 110
- Joined: Thu Feb 19, 2009 9:57 am
- Location: Cambridgeshire / Hertfordshire, Great Britain, Centre of the Universe
- Contact:
Re: Detection of browser language setting not working?
I've just stumbled upon this problem on a new project I've literally just started!
J! 2.5.4
SEF enabled
Lang switch plugin enabled
Lang switch module published (but I don't want this really!)
EN and FR setup with test articles and test lang specific menus and menu items as outlined in the articles: http://docs.joomla.org/Language_Switche ... Joomla_1.6
I've tried all combinations of configuration but no joy! It always defaults to EN!
Has anyone found a solution yet by any chance?
J! 2.5.4
SEF enabled
Lang switch plugin enabled
Lang switch module published (but I don't want this really!)
EN and FR setup with test articles and test lang specific menus and menu items as outlined in the articles: http://docs.joomla.org/Language_Switche ... Joomla_1.6
I've tried all combinations of configuration but no joy! It always defaults to EN!
Has anyone found a solution yet by any chance?
Joomla CMS Developer: http://www.kharmer.co.uk
- infograf768
- Joomla! Master
- Posts: 19133
- Joined: Fri Aug 12, 2005 3:47 pm
- Location: **Translation Matters**
Re: Detection of browser language setting not working?
We have reverted a wrong patch and corrected the file for 2.5.5.
Here is the present replacement file for languagefilter.php Decompress and replace plugins/system/languagefilter/languagefilter.php
Here is the present replacement file for languagefilter.php Decompress and replace plugins/system/languagefilter/languagefilter.php
You do not have the required permissions to view the files attached to this post.
Jean-Marie Simonet / infograf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group
-
- Joomla! Enthusiast
- Posts: 110
- Joined: Thu Feb 19, 2009 9:57 am
- Location: Cambridgeshire / Hertfordshire, Great Britain, Centre of the Universe
- Contact:
Re: Detection of browser language setting not working?
Thanks very much for your speedy response.
I've tried replacing the file you supplied in the post above and having tested am still getting the same result! It seems to persist to always default to the default language (EN).
I do still have SEF enabled; however SEF is a must in this instance.
To test, I have chrome setup using FR language. When I was trying to debug this lang switcher plugin it appears that the value returned by 'JLanguageHelper::detectLanguage()' in the 'buildRule' method is always returning 'en-GB'. I'm outputting values in this method to screen and I can see at first no language is set by cookie and then the 'detect browser' returns a true value but then when detecting browser language immediately after it always returns 'en-GB'!
Might be barking up the wrong tree but thought I'd mention it.
Thanks again...
I've tried replacing the file you supplied in the post above and having tested am still getting the same result! It seems to persist to always default to the default language (EN).
I do still have SEF enabled; however SEF is a must in this instance.
To test, I have chrome setup using FR language. When I was trying to debug this lang switcher plugin it appears that the value returned by 'JLanguageHelper::detectLanguage()' in the 'buildRule' method is always returning 'en-GB'. I'm outputting values in this method to screen and I can see at first no language is set by cookie and then the 'detect browser' returns a true value but then when detecting browser language immediately after it always returns 'en-GB'!
Might be barking up the wrong tree but thought I'd mention it.
Thanks again...
Joomla CMS Developer: http://www.kharmer.co.uk
- infograf768
- Joomla! Master
- Posts: 19133
- Joined: Fri Aug 12, 2005 3:47 pm
- Location: **Translation Matters**
Re: Detection of browser language setting not working?
Normally should depend on the Languagefilter plugin parameters.
Check these please.
Check these please.
Jean-Marie Simonet / infograf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group
-
- Joomla! Enthusiast
- Posts: 110
- Joined: Thu Feb 19, 2009 9:57 am
- Location: Cambridgeshire / Hertfordshire, Great Britain, Centre of the Universe
- Contact:
Re: Detection of browser language setting not working?
Sure, here are my current settings for the language switcher plugin.
Language Selection for new Visitors: Browser Settings
Automatic Language Change: Yes
Menu associations: Yes
Remove URL Language Code: No
Add alternate meta tags: No
Thanks again for your help,
Kris...
Language Selection for new Visitors: Browser Settings
Automatic Language Change: Yes
Menu associations: Yes
Remove URL Language Code: No
Add alternate meta tags: No
Thanks again for your help,
Kris...
Joomla CMS Developer: http://www.kharmer.co.uk
- infograf768
- Joomla! Master
- Posts: 19133
- Joined: Fri Aug 12, 2005 3:47 pm
- Location: **Translation Matters**
Re: Detection of browser language setting not working?
Is it clear for you that browser settings is only used for first visit?
I.e. after first visit, a cookie is set and it is the last language displayed that will be used?
To test (wiht the file above), you have yo delete all cookies first.
I.e. after first visit, a cookie is set and it is the last language displayed that will be used?
To test (wiht the file above), you have yo delete all cookies first.
Jean-Marie Simonet / infograf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group
-
- Joomla! Enthusiast
- Posts: 110
- Joined: Thu Feb 19, 2009 9:57 am
- Location: Cambridgeshire / Hertfordshire, Great Britain, Centre of the Universe
- Contact:
Re: Detection of browser language setting not working?
Yeah - each time I retried I completely cleared cookies/cache/history just to be sure.
I'm tempted to install 2.5.3 just to see if my configuration is correct as I've read that this problem with automatic language detection only came about from 2.5.4!
Cheers,
Kris...
I'm tempted to install 2.5.3 just to see if my configuration is correct as I've read that this problem with automatic language detection only came about from 2.5.4!
Cheers,
Kris...
Joomla CMS Developer: http://www.kharmer.co.uk
- infograf768
- Joomla! Master
- Posts: 19133
- Joined: Fri Aug 12, 2005 3:47 pm
- Location: **Translation Matters**
Re: Detection of browser language setting not working?
Please send me a pm with superuser access and I will have a look (make sure that le plugin file has been updated to the one above)
Jean-Marie Simonet / infograf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group
-
- Joomla! Apprentice
- Posts: 5
- Joined: Tue Aug 16, 2011 5:23 pm
Re: Detection of browser language setting not working?
Hi.
I have set up En, FR & Es languages on a site.
everything works fine (the languages are changing, no problem with the click on Home or logo) but I have this problem:
Now if I select for ex: Spanish and I close the browser window, the next time I open it the site language is Spanish. I wold like that every time I open the browser the language to be English (the default one).
How can I do that?
Thanks
Alin
I have set up En, FR & Es languages on a site.
everything works fine (the languages are changing, no problem with the click on Home or logo) but I have this problem:
Now if I select for ex: Spanish and I close the browser window, the next time I open it the site language is Spanish. I wold like that every time I open the browser the language to be English (the default one).
How can I do that?
Thanks
Alin
- infograf768
- Joomla! Master
- Posts: 19133
- Joined: Fri Aug 12, 2005 3:47 pm
- Location: **Translation Matters**
Re: Detection of browser language setting not working?
You can't change this behavior. As stated above, a cookie is set when you display a specific Content language and changes depending on the last Content Language displayed.
To get rid of this cookie would necessitate a core hack of the languagefilter plugin
To get rid of this cookie would necessitate a core hack of the languagefilter plugin
Jean-Marie Simonet / infograf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group
-
- Joomla! Apprentice
- Posts: 5
- Joined: Tue Aug 16, 2011 5:23 pm
Re: Detection of browser language setting not working?
but the demo site http://multilingual.demojoomla.com works exactly like I want...
I select a language and if I close the browser the next time I open it's still English the default one.
I select a language and if I close the browser the next time I open it's still English the default one.
- infograf768
- Joomla! Master
- Posts: 19133
- Joined: Fri Aug 12, 2005 3:47 pm
- Location: **Translation Matters**
Re: Detection of browser language setting not working?
Are you testing with the new languagefilter file posted above?
Jean-Marie Simonet / infograf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group
-
- Joomla! Apprentice
- Posts: 5
- Joined: Tue Aug 16, 2011 5:23 pm
Re: Detection of browser language setting not working?
Yes the languagefilter.php file is the one posted above . Can you tell me what to change to get the desired result?
Thanks.
Thanks.