# i18n

## Purpose

The `i18n` plug-in sets up Grails' support for Internationalization.

## Examples

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

    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

## Description

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

Configured Spring Beans:

- `messageSource` - An instance the Spring org.springframework.context.support.ReloadableResourceBundleMessageSource class which is used to resolve messages.
- `localeChangeInterceptor` - An instance of the Spring org.springframework.web.servlet.i18n.LocaleChangeInterceptor class which is used to switch locales using a `lang` request parameter.
- `localeResolver` - An instance of the Spring org.springframework.web.servlet.i18n.CookieLocaleResolver class that is used to store the user locale in a cookie.