我需要在GSP中以不同的语言环境显示句子。
以下文档指出g:message具有语言环境参数。
我在任何地方都找不到这样的例子。有人这样做吗?
<p><g:message code="welcome.into.text1" locale="sv_SE"/></p>
<p><g:message code="welcome.into.text1" locale="en_US"/></p>
显然,我有messages_sv.properties和messages_en_US.properties。
谢谢
最佳答案
要明确指定语言环境,请使用Locale对象而不是String,例如:
<g:message code="welcome.into.text1" locale="${Locale.US}"/>
关于grails - 在一页上以不同的语言环境显示文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14384952/