////
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
////


== i18n



=== Purpose


The `i18n` plugin configures Grails' support for link:{guidePath}/i18n.html[Internationalization].


=== Examples


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

[source,groovy]
----
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 link:{guidePath}/i18n.html[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.
