-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support resolving i18n message with standard way (#6648)
#### What type of PR is this? /kind feature /area theme /sig docs /milestone 2.20.x #### What this PR does / why we need it: After this PR, we can define i18n message files next to the template file. ```yaml i18n: default.properties templates: index.html index.properties # Higher properties than default.properties index_zh.properties # Higher properties than index.properties index_zh_CN.properties # Higher priority than index_zh.properties ``` It's convenient for plugins that define the template files. See https://www.thymeleaf.org/doc/tutorials/3.1/usingthymeleaf.html#standard-message-resolver for more. #### Does this PR introduce a user-facing change? ```release-note 支持在主题中通过 Thymeleaf 默认行为实现国际化 ```
- Loading branch information
Showing
8 changed files
with
23 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
application/src/test/resources/themes/default/i18n/default.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
index.welcome=\u6B22\u8FCE\u6765\u5230\u9996\u9875 | ||
index.welcome=欢迎来到首页 | ||
title=这是来自 i18n/default.properties 的标题 |
1 change: 1 addition & 0 deletions
1
application/src/test/resources/themes/default/i18n/zh.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
title=来自 i18n/zh.properties 的标题 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
application/src/test/resources/themes/default/templates/index.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
title=Title from index.properties |
1 change: 1 addition & 0 deletions
1
application/src/test/resources/themes/default/templates/index_zh.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
title=来自 index_zh.properties 的标题 |