I want make a multi-language app I heard about .po files but I can't locate it I made this code

I made a directory in my application called languages and I put the ar_EG.po file in it and I tried languages\ar\LC_MESSAGES but it dosen't work too

putenv('LC_ALL=ar_EG');
setlocale(LC_ALL, 'ar_EG', 'ara_EGY');

$domain = 'ar_EG';
bindtextdomain($domain, "./languages"); // I think the error here
textdomain($domain);

// to verify that localization is enabled and it works as intended:
echo strftime("%A %B %Y", strtotime("01/30/2013")), "<br>";

echo gettext("login"); // here not working 
有帮助吗?

解决方案

The server must be restarted after editing. Thanks all for your help

其他提示

You need to compile your po file into a mo file, and put that in there instead...

Also, you need to make sure that GetText is installed...

http://www.php.net/manual/en/book.gettext.php

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top