disable the browser language detection?
Hi,
Trying to disable the automatic language detection by browser settings, independently on what the broswer language is, always go to the typolight default language.
Tried to modify it "manually" in the initialize.php by setting the $GLOBALS['TL_LANGUAGE'] to the desired language code, but can't seem to find where the "jump" is actually done.
Thanks.
Roger
Re: disable the browser language detection?
I found the place, in the frontend module the lang array is based on the browser settings:
$accept_language = $this->Environment->httpAcceptLanguage;
Modified that to the desired default language.
Maybe it would be nice to add a "Disable browser language detection" in the System->Settings->Front end configuration, just a thought.
Re: disable the browser language detection?
Why is it necessary to disable the detection? Are there any disadvantages of having it enabled?
Best,
Helmut
Re: disable the browser language detection?
In a world where english seems to be the "international" language, as it is now is perfect.
But sometimes it is required that the default language is not automated to browser set up, and more according to what the language is of the final users it is targeted to, here in Spain we have many "small languages" that are not always in the browser set up.
Best.
Roger
Re: disable the browser language detection?
Ok. What I was intending with my question: Do you know that there is a fallback setting in TYPOlight? Making your main site the fallback site (maybe the spanish site) forces browsers in other languages than this site to open the fallback site automatically if there is no special site available in the browser language.
This might solve your problem without changing the code. But If you want to be independent of the language selection, I suppose changing the code is the only option.
Best,
Helmut
Re: disable the browser language detection?
maybe this?:
system/config/initconfig.php
put:
$objEnvironment->httpAcceptLanguage=array('sl');
..now this is your default language
:roll: