【问题标题】:.po translate issue for wordpress?.po 为 wordpress 翻译问题?
【发布时间】:2019-10-03 02:32:53
【问题描述】:

我正在使用 wordpress。我有一个 .po 文件。例如,我想翻译这一行。但是当我这样做时,没有任何变化。

<h3 class="title">Personal Details</h3>

--.po 代码:

#: dosya/kullanici.php:16
msgid "Personal Details"
msgstr "Personel Detayları"

【问题讨论】:

    标签: wordpress translate


    【解决方案1】:

    要显示必须替换的翻译文本:

    个人资料

    使用上述功能(另请参阅文档的链接): esc_html_e(string $text, string $domain = 'default')

    https://developer.wordpress.org/reference/functions/esc_html_e/

    例如你可以写:

    您需要翻译功能,并且您需要主题的文本域。

    【讨论】:

    【解决方案2】:

    在 wp-config.php 中将 WPLANG 定义为您选择的语言。例如,如果你想使用法语,那么你需要定义define ('WPLANG', 'fr_FR');在 wp-config.php 文件中。同时将 .po 文件放入当前主题文件夹中。

    【讨论】:

      猜你喜欢
      • 2017-11-02
      • 2015-02-11
      • 1970-01-01
      • 2011-06-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-11-27
      • 2021-10-16
      相关资源
      最近更新 更多