(Quick Reference)

i18n

Purpose

The i18n plugin configures Grails' support for Internationalization.

Examples

An example messages.properties within the grails-app/i18n directory:

default.created.message={0} {1} created
default.updated.message={0} {1} updated
default.deleted.message={0} {1} deleted
default.not.deleted.message={0} {1} could not be deleted
default.not.found.message={0} not found with id {1}

Description

Refer to the section on Internationalization in the Grails user guide which details Grails' i18n support.

Configured Spring Beans:

  • messageSource - An instance the Spring {springapi}org/springframework/context/support/ReloadableResourceBundleMessageSource.html[ReloadableResourceBundleMessageSource] class which is used to resolve messages.

  • localeChangeInterceptor - An instance of the Spring {springapi}org/springframework/web/servlet/i18n/LocaleChangeInterceptor.html[LocaleChangeInterceptor] class which is used to switch locales using a lang request parameter.

  • localeResolver - An instance of the Spring {springapi}org/springframework/web/servlet/i18n/CookieLocaleResolver.html[CookieLocaleResolver] class that is used to store the user locale in a cookie.