Apache 2.4 + PHP 5.5
putenv('LC_ALL=ru_RU');
setlocale(LC_ALL, 'ru_RU');
bindtextdomain('mydomain', '/absolute/path/to/messages');
textdomain('mydomain');
I'm absolutely sure, than I've mydomain.po
and mydomain.mo
files in /absolute/path/to/messages/ru_RU/LC_MESSAGES/
.
Also I gave these files to my colleague on OS X Maverics - worked fine.
I can't make php gettext working.
I've googled/stackoverflowed for about couple of hours, tried various solutions - still not working. What I do wrong?
I restart apache every time I change something to ensure gettext files is being reloaded.
Here is my locale -a
output:
miraage@ubuntu:~$ locale -a
C
C.UTF-8
....
en_GB.utf8
....
POSIX
ru_RU.utf8
ru_UA.utf8
One more cmd output:
miraage@ubuntu:~$ sudo locale-gen ru
Generating locales...
ru_RU.UTF-8... up-to-date
ru_UA.UTF-8... up-to-date
Generation complete.
Okay, I've figured out:
sudo locale-gen ru_RU
(added new locale, but different charset)
and
then setlocale(LC_ALL, 'ru_RU.UTF-8');
did all work.
Thanks for help.