我现在正在努力使用 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.