【发布时间】:2009-09-20 01:33:23
【问题描述】:
我在 poedit 中创建了一个语言文件以使用 PHP gettext 函数,现在在我尝试对其进行测试的页面上,我无法找到/加载我创建的 .po 或 .mo 文件,有人看到我做错了吗?
$locale = "en_US";
putenv("LC_ALL=$locale");
setlocale(LC_ALL, $locale);
bindtextdomain("default", "/includes/locale");
textdomain("default");
//my .po ad .mo file is located here /includes/locale/en/default.mo
即使我正在尝试加载默认的英语语言文件,我已经更改了文件中的一些文本以确保它是从语言文件中读取的,并且目前它只显示默认文本而不进行翻译,我认为我可能走错了路
【问题讨论】:
-
PHP-I18N 为您做这一切。