【发布时间】:2016-05-02 08:01:42
【问题描述】:
问题
正如我在 Timber 文档中看到的,可以添加多语言支持,例如 this:
// Set language to French
putenv('LC_ALL=fr_FR');
setlocale(LC_ALL, 'fr_FR');
// Specify the location of the translation tables
bindtextdomain('myAppPhp', 'includes/locale');
bind_textdomain_codeset('myAppPhp', 'UTF-8');
// Choose domain
textdomain('myAppPhp');
{% trans "Hello World!" %}
{% trans string_var %}
{% trans %}
Hello World!
{% endtrans %}
问题是,像这样我有静态网站 - 将被翻译成法语,但我无法从 wp-backend 向它添加多语言内容。所以我确信有更好的方法来实现使用 Timber 编写的 WordPress 主题的多语言支持。
问题
我想知道用 Timber 构建 WordPress 主题并实现对它的多语言支持的最佳和最可靠的方法是什么。
有什么最佳做法吗?
【问题讨论】:
标签: php wordpress wordpress-theming multilingual timber