【发布时间】:2017-03-13 16:32:05
【问题描述】:
我正在尝试使用 Javascript 从我在 AEM 的翻译器 (/libs/cq/i18n/translator.html) 中创建的字典中动态检索翻译的消息。
我们的字典值设置如下:
String EN FR
========================================================
TEST-001 This is a Test1 FR:This is a Test1
TEST-002 This is a Test2 FR:This is a Test2
TEST-003 This is a Test3 FR:This is a Test3
我已经阅读了国际化 UI 字符串文章 (https://docs.adobe.com/docs/en/aem/6-2/develop/components/i18n/i18n-dev.html),但是当我尝试以下操作时:
Granite.I18n.setLocale("en");
Granite.I18n.get("TEST-001");
或
Granite.I18n.setLocale("fr");
Granite.I18n.get("TEST-001");
我只返回我传入的字符串(即“TEST-001”)。
有人可以帮我理解如何取回翻译后的值吗?
谢谢!
【问题讨论】:
标签: javascript internationalization adobe aem translate