我想做一个多语言的应用我听说过.po文件但是我找不到它我写了这段代码
我在应用程序中创建了一个名为languages的目录,并将ar_EG.po文件放入其中,然后尝试使用languages\ar\LC_MESSAGES,但也不起作用
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 发布于 2013-02-21 19:50:13
编辑后必须重新启动服务器。感谢所有人的帮助
发布于 2013-02-20 22:41:00
您需要将po文件编译为mo文件,并将其放入其中...
此外,您还需要确保安装了GetText ...
http://www.php.net/manual/en/book.gettext.php
https://stackoverflow.com/questions/14982513
复制相似问题