PHP gettext doesn't works

前端 未结 1 575
小鲜肉
小鲜肉 2021-01-23 08:53

Apache 2.4 + PHP 5.5

putenv(\'LC_ALL=ru_RU\');
setlocale(LC_ALL, \'ru_RU\');
bindtextdomain(\'mydomain\', \'/absolute/path/to/messages\');
textdomain(\'mydomai         


        
1条回答
  •  再見小時候
    2021-01-23 09:26

    It is a long time asked question, but maybe one more check will help someone who will try everything "just by instruction" and still doesn't work.

    That is collision with LANGUAGE environment variable.

    In my case a while ago after a long fight, I figured out that it was causing the issue. Removing that environment variable export LANGUAGE= (empty, after =) resolved normal setLocale behavior.

    0 讨论(0)
提交回复
热议问题