我已经努力了一段时间,尝试使用PHP的gettext()函数进入翻译文件并使用Poedit创建文件。Poedit也没有带有帮助文件,我尝试了很多在网上找到的方法,但是都不起作用。我使用的是Mac OSX和XAMPP配置。
在OSX上,我的XAMPP目录为
/Applications/XAMPP/xamppfiles/htdocs/
在这个目录下,我使用以下内容创建了gettext.php文件:
<?php echo _("Hello World"); ?>
以及以下文件夹:
/locale/
/locale/it_IT/LC_MESSAGES/
当我使用Poedit时,我执行 > 文件 > 新建目录
语言:意大利语
国家:意大利
字符集:UTF-8
源代码字符集:UTF-8
基本路径:/Applications/XAMPP/xamppfiles/htdocs/
然后我将default.po保存到/locale/it_IT/LC_MESSAGES/
"更新目录失败。单击“更多>>”以获取详细信息。
13:04:10: Poedit did not find any files in scanned directories.
13:04:11: Entries in the catalog are probably incorrect.
13:04:11: Updating the catalog failed. Click on 'More>>' for details.