我可以使用带有空格和一些特殊字符的 i18n 键名吗?

can i use i18n key name with spaces and some special characters?

我想在 i18n 中使用 JSTL 标签。

在创建 i18n 键值对时,我可以使用带有空格和一些特殊字符的 i18n 键名吗?

是的。 i18n 字典中的键是英文字符串。来自 AEM Maven 原型的示例:

i18n 法语词典位于 /ui.apps/src/main/content/jcr_root/apps/demosite/i18n/fr.xml

<copyright
    jcr:mixinTypes="[sling:Message]"
    jcr:primaryType="nt:folder"
    sling:key="&amp;copy; {0} AEM Demo Site. All rights reserved."
    sling:message="&amp;copy; {0} AEM Demo Site. Tous droits réservés."/>

并且在 /ui.apps/src/main/content/jcr_root/apps/demosite/components/structure/page/partials/main.html 处使用的字符串:

<footer class="page__footer">
    <p class="page__copyright">${"&copy; {0} AEM Demo Site. All rights reserved." @ i18n, format=main.year, context='html'}</p>
</footer>