【发布时间】:2018-09-24 12:24:07
【问题描述】:
我正在尝试在 Silverstripe 的模板中使用 i18n 功能。
在模板 ss 文件中,我有以下内容:
<h4 class="red-underline"><%t Namespace1.Replace "ToBeReplaced" %></h4>
我在 /lang/en_US.yml 中有以下内容:
en:
Namespace1:
Replace: 'ReplacedString'
我也将此添加到我的 _config.php:
use SilverStripe\i18n\i18n;
i18n::set_locale('en_US');
这在我的 config.yml 中:
SilverStripe\i18n\i18n:
common_locales:
en_US:
name: English (USA)
native: English
但是字符串“ToBeReplaced”没有被替换。 我可以找到的有关此的文档是: https://docs.silverstripe.org/en/4/developer_guides/i18n/
我错过了什么吗?
【问题讨论】:
标签: internationalization silverstripe silverstripe-4