public function setLanguage(/*...*/)
    {
        $langs = func_get_args();

        $langCode = $this->trySettingLanguages(LC_ALL, $langs);
        if ($langCode) return $langCode;

        if (defined("LC_MESSAGES")) {
            $langCode = $this->trySettingLanguages(LC_MESSAGES, $langs);
            if ($langCode) return $langCode;
        }

        throw new PHPTAL_ConfigurationException('Language(s) code(s) "'.implode(', ', $langs).'" not supported by your system');
    }
public function setLanguage(/*...*/)
    {
        $langs = func_get_args();

        $langCode = $this->trySettingLanguages(LC_ALL, $langs);
        if ($langCode) return $langCode;

        if (defined("LC_MESSAGES")) {
            $langCode = $this->trySettingLanguages(LC_MESSAGES, $langs);
            if ($langCode) return $langCode;
        }

        throw new PHPTAL_ConfigurationException('Language(s) code(s) "'.implode(', ', $langs).'" not supported by your system');
    }
public function setLanguage ( /*...*/ ) { $ langs = func_get_args ( ) ; $ langCode = $ this -> trySettingLanguages ( LC_ALL , $ langs ) ; if ( $ langCode ) return $ langCode ; if ( defined ( "LC_MESSAGES" ) ) { $ langCode = $ this -> trySettingLanguages ( LC_MESSAGES , $ langs ) ; if ( $ langCode ) return $ langCode ; } throw new PHPTAL_ConfigurationException ( 'Language(s) code(s) "' . implode ( ', ' , $ langs ) . '" not supported by your system' ) ; }
It expects locale names as arguments.
Choses first one that works.

setLanguage("en_US.utf8","en_US","en_GB","en")

@return string - chosen language
It expects locale names as arguments . Choses first one that works .