我已经努力了很长一段时间才能通过PHP的gettext()函数进入翻译文件,并用Poedit创建文件。Poedit也没有提供帮助文件,我尝试了很多在网上找到的东西,但都不起作用。我在Mac上使用XAMPP配置。
在OSX上,我的XAMPP目录是
/Applications/XAMPP/xamppfiles/htdocs/在这个目录中,我用它创建了gettext.php
<?php echo _("Hello World"); ?>和以下文件夹:
/locale/
/locale/it_IT/LC_MESSAGES/使用Poedit when I do > File > New Catalog
语言:意大利语
国家:意大利
字符集: UTF-8
源码字符集: UTF-8
基本路径: /Applications/XAMPP/xamppfiles/htdocs/
然后将default.po保存到/locale/it_IT/LC_MESSAGES/
“更新目录失败。有关详细信息,请单击'More>>‘
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.发布于 2010-09-17 20:22:45
Poedit和gettext本身有些奇怪。我刚刚自己尝试并得到了错误消息,因为我忘记了一个关键的设置。进入目录>选项和路径选项卡,将基本路径复制到路径列表中。我猜,Poedit使用基本路径来定位.po文件。找不到实际的源文件,除非您设置了( source ?)路径。那么菜单项catalogue > read from source files也应该是可用的。
发布于 2013-12-25 11:26:19
其他参考:当我试图更新Javascript源代码时,我看到了同样的神秘消息。
原来我没有把Javascript解析器添加到PoEdit中。我按照下面这些有用的步骤修复了这个问题:
https://stackoverflow.com/questions/3709146
复制相似问题