Comment to 'Language change as per region '
  • Let's review how UNA checks what language should be set for the user (my comments are bold):

    // 1. check if user has the language argument in the URL (GET parameter)

    if(!$sLang && !empty($_GET['lang']))

                $sLang = $this->tryToGetLang($_GET['lang'], $bSetCookie);

    // 2. check if user has the POST argument with the language

            if(!$sLang && !empty($_POST['lang']))

                $sLang = $this->tryToGetLang($_POST['lang'], $bSetCookie);

    // 3. check if user already visit this site and chose langauge (COOKIE setting)

            if(!$sLang && !empty($_COOKIE['lang']))

                $sLang = $this->tryToGetLang($_COOKIE['lang']);

    // 4. check the settings of the browser

            if(!$sLang && !empty($_SERVER['HTTP_ACCEPT_LANGUAGE']))

                $sLang = $this->tryToGetLang($_SERVER['HTTP_ACCEPT_LANGUAGE']);

    // 5. set the default languge from Studio settings

            if(!$sLang)

                $sLang = $this->tryToGetLang(getParam('lang_default'));

    // 6. set the default lang form constant

            if(!$sLang)

                $sLang = $this->tryToGetLang(BX_DOL_LANGUAGE_DEFAULT);

    As you may see in the step 4 UNA tries to define the browser settings of the first-time site's visitor. But all these steps work if the necessary language is installed. For example, if the guest from Russia will visit UNA site with English and Italian only then he will see the default English, but the Italians will see the correct language from the beginning.