本地化在远程服务器上不起作用

时间:2013-03-04 08:46:42

标签: php localization

在我的本地机器上我使用本地化它可以工作,但是当在远程服务器上时,它没有。 php扩展已启用,我没有收到任何错误消息。 用户有一个下拉菜单来选择一种语言,一旦他做了,字符串应该被翻译(再次在我的本地机器上工作)。

这是我的代码:

if(!isset($_COOKIE["locale"]))
{
setcookie("locale", $configSite->  getValue('siteLang', 'language'),time()+60*60*24*30, "/");

        $locale =   $configSite->  getValue('siteLang', 'language');
}else{
         $locale = $_COOKIE["locale"]; 

}

putenv("LC_ALL=$locale");//needed on some systems
putenv("LANGUAGE=$locale");//needed on some systems
setlocale(LC_ALL, $locale);
bindtextdomain("messages", "./locale");
bind_textdomain_codeset("messages", "UTF-8");
textdomain("messages");

我检查了所有变量,一旦我更改了语言,它们就会发生变化,但字符串不会被翻译。

最好的问候

0 个答案:

没有答案