i18n
为 Grails 提供了 Internationalization 的支持.
messages.properties
在 grails-app/i18n
目录中:
default.doesnt.match.message=Property [{0}] of class [{1}] with value [{2}] does not match the required pattern [{3}] default.invalid.url.message=Property [{0}] of class [{1}] with value [{2}] is not a valid URL default.invalid.creditCard.message=Property [{0}] of class [{1}] with value [{2}] is not a valid credit card number
messageSource
-Spring org.springframework.context.support.ReloadableResourceBundleMessageSource 类的实例 ,用来处理消息.localeChangeInterceptor
- Spring org.springframework.web.servlet.i18n.LocaleChangeInterceptor 类的实例,修改本地化信息 可以侦测请求中某个特定的参数,然后调用上下文中的LocaleResolver中的 setLocale()方法,相应地修改本地化信息。 localeResolver
- Spring org.springframework.web.servlet.i18n.CookieLocaleResolver 类的实例, 存储用户区域,并可通过cookie来确定用户区域.