【发布时间】:2015-08-02 09:26:35
【问题描述】:
我正在考虑将可本地化的字符串添加到 wordpress 子主题中,但未能成功。
我有一个带有 .php 页面的子主题,我想在其中添加一个可本地化的字符串。在我的子主题的functions.php 中,我添加了以下行:
load_theme_textdomain( 'i-craft-child', get_template_directory() . '/languages' );
接下来,我使用 Loco Translate 将文件 de_DE.po 和 de_DE.mo 上传到子主题目录中的目录 /languages。
最后,我在我的 html 页面中添加了以下行:
<span><small>><?php _e( 'Your email address is also your username and it cannot be changed', 'i-craft-child' ); ?></small></span>
但是,上面的span 以英语(而不是德语)显示。我不确定我在本地化过程中哪里失败了,如果有任何解决这个问题的建议,我将不胜感激。
【问题讨论】:
标签: php wordpress localization