Internationalization Silverstripe模板i18n翻译
我正在尝试在Silverstripe的模板中使用i18n功能 在模板ss文件中,我有以下内容:Internationalization Silverstripe模板i18n翻译,internationalization,silverstripe,silverstripe-4,Internationalization,Silverstripe,Silverstripe 4,我正在尝试在Silverstripe的模板中使用i18n功能 在模板ss文件中,我有以下内容: <h4 class="red-underline"><%t Namespace1.Replace "ToBeReplaced" %></h4> 我还将此添加到我的\u config.php: en: Namespace1: Replace: 'ReplacedString' use SilverStripe\i18n\i18n; i18n::set_
<h4 class="red-underline"><%t Namespace1.Replace "ToBeReplaced" %></h4>
我还将此添加到我的\u config.php:
en:
Namespace1:
Replace: 'ReplacedString'
use SilverStripe\i18n\i18n;
i18n::set_locale('en_US');
SilverStripe\i18n\i18n:
common_locales:
en_US:
name: English (USA)
native: English
在我的config.yml中:
en:
Namespace1:
Replace: 'ReplacedString'
use SilverStripe\i18n\i18n;
i18n::set_locale('en_US');
SilverStripe\i18n\i18n:
common_locales:
en_US:
name: English (USA)
native: English
但是字符串“tobereplace”没有被替换。
我能找到的关于这一点的文档是:
我遗漏了什么吗?问题是lang文件夹添加到了错误的位置 它应该位于/mysite/lang/