mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-09-03 04:26:12 +08:00
Merge pull request #15881 from kedar-joshi
* pr/15881: Polish "Document internationalization support" Document internationalization support
This commit is contained in:
commit
04aacdb37a
@ -2005,6 +2005,35 @@ However, properties can be added to the `Environment` by using the relaxed rules
|
||||
|
||||
|
||||
|
||||
[[boot-features-internationalization]]
|
||||
== Internationalization
|
||||
Spring Boot supports localized messages so that your application can cater to users
|
||||
of different language preferences. By default, Spring Boot looks for the presence of
|
||||
a `messages` resource bundle at the root of the classpath.
|
||||
|
||||
NOTE: The auto-configuration applies when the default properties file for the configured
|
||||
resource bundle is available (i.e. `messages.properties` by default). If your resource
|
||||
bundle contains only language-specific properties files, you are required to add the
|
||||
default.
|
||||
|
||||
The basename of the resource bundle as well as several other attributes can be configured
|
||||
using the `spring.messages` namespace, as shown in the following example:
|
||||
|
||||
[source,properties,indent=0]
|
||||
----
|
||||
spring.messages.basename=messages,config.i18n.messages
|
||||
spring.messages.fallback-to-system-locale=false
|
||||
----
|
||||
|
||||
TIP: `spring.messages.basename` supports comma-separated list of locations, either a
|
||||
package qualifier or a resource resolved from the classpath root.
|
||||
|
||||
See {sc-spring-boot-autoconfigure}/context/MessageSourceProperties.{sc-ext}[
|
||||
`MessageSourceProperties`] for more supported options.
|
||||
|
||||
|
||||
|
||||
|
||||
[[boot-features-json]]
|
||||
== JSON
|
||||
Spring Boot provides integration with three JSON mapping libraries:
|
||||
|
Loading…
Reference in New Issue
Block a user