Results 1 to 6 of 6

Thread: disable the browser language detection?

  1. #1
    New user
    Join Date
    06-29-09.
    Location
    Barcelona
    Posts
    3

    Default 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

  2. #2
    New user
    Join Date
    06-29-09.
    Location
    Barcelona
    Posts
    3

    Default 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.

  3. #3
    User
    Join Date
    06-10-09.
    Location
    Loxstedt, Germany
    Posts
    54

    Default Re: disable the browser language detection?

    Why is it necessary to disable the detection? Are there any disadvantages of having it enabled?
    Best,
    Helmut
    Blackmail's such an ugly word. I prefer extortion -- the "x" makes it sound cool.
    -- Bender

  4. #4
    New user
    Join Date
    06-29-09.
    Location
    Barcelona
    Posts
    3

    Default 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

  5. #5
    User
    Join Date
    06-10-09.
    Location
    Loxstedt, Germany
    Posts
    54

    Default 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
    Blackmail's such an ugly word. I prefer extortion -- the "x" makes it sound cool.
    -- Bender

  6. #6
    New user
    Join Date
    06-21-09.
    Posts
    27

    Default Re: disable the browser language detection?

    maybe this?:

    system/config/initconfig.php
    put:
    $objEnvironment->httpAcceptLanguage=array('sl');
    ..now this is your default language
    :roll:
    ConTao rules!
    Thank you Leo and the team.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •