# 7.5.国际化

Spring Boot 支持本地化消息，以便您的应用程序可以满足不同语言偏好的用户。默认情况下，Spring Boot在类路径的根目录中查找`messages`资源包的存在。

当配置的资源包的默认属性文件可用时（默认情况下为`messages.properties`），自动配置适用。如果您的资源包仅包含特定于语言的属性文件，则需要添加默认值。如果没有找到与任何配置的基本名称匹配的属性文件，则不会有自动配置的 `MessageSource`。 可以使用`spring.messages`命名空间配置资源包的基本名称以及其他几个属性，如下例所示：

```
spring.messages.basename=messages,config.i18n.messages
spring.messages.fallback-to-system-locale=false
```

`spring.messages.basename`支持以逗号分隔的位置列表，可以是包限定符，也可以是从类路径根解析的资源。 更多支持选项，请参阅[`MessageSourceProperties`](https://github.com/spring-projects/spring-boot/tree/v2.7.3/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/context/MessageSourceProperties.java)。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.shiker.tech/spring-boot-can-kao-wen-dang/7.-he-xin-te-xing/7.5.-guo-ji-hua.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
