@org.springframework.boot.autoconfigure.AutoConfiguration(before = { MessageSourceAutoConfiguration.class, WebMvcAutoConfiguration.class })
@org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.SERVLET)
public class I18nAutoConfiguration
extends java.lang.Object
| Type Params | Return Type | Name and description |
|---|---|---|
|
public AvailableLocaleResolver |
availableLocaleResolver(GrailsApplication grailsApplication, boolean includePlugins)Discovers the locales the application is translated into (from <basename>_<locale>.properties
bundles on the classpath) so that a language selector can list only real translations rather
than every JVM locale. |
|
public LocaleChangeInterceptor |
localeChangeInterceptor() |
|
public LocaleResolver |
localeResolver() |
|
public MessageSource |
messageSource(GrailsApplication grailsApplication, GrailsPluginManager pluginManager) |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#equals(java.lang.Object), java.lang.Object#getClass(), java.lang.Object#hashCode(), java.lang.Object#notify(), java.lang.Object#notifyAll(), java.lang.Object#toString(), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int) |
Discovers the locales the application is translated into (from <basename>_<locale>.properties
bundles on the classpath) so that a language selector can list only real translations rather
than every JVM locale. Published to the servlet context by I18nGrailsPlugin and
consumed by the g:localeSelect available="true" tag.
By default every *.properties bundle on the classpath is considered, so locales
contributed by plugins — whose bundles are namespaced (e.g.
spring-security-core_*.properties) — are included alongside the application's own.
Set grails.i18n.availableLocales.includePlugins=false to restrict discovery to the
application's own messages_*.properties bundles.
The base messages.properties locale is always included, resolved from
grails.i18n.default.locale exactly like the rest of this class (falling back to the
JVM default locale when the property is not set).
includePlugins - whether to also scan plugin-contributed message bundles
(grails.i18n.availableLocales.includePlugins, defaults to true)