1、解决 IntelliJ IDEA 中 i18n国际化 中文乱码问题。
IntelliJ IDEA 中默认的properties文件是GBK编码。修改properties的默认编码,统一为UTF-8。
File Encodings -> Default encoding for properties file -> UTF-8
2、Idea国际化中文properties内容显示
使用idea工具开发国际化功能时,如果未对properties文件进行设置,则中文内容会显示为类似下面的格式:
\u60a8\u597d\uff01
进入setting,file encoding,勾选Transparent native-to-ascii conversion。

3、国际化配置操作
- 在resources新建一个名叫“i18n”的包,我们用来存放国际化配置;
默认生效的messages.properties
中文生效的messages_zh_CN.properties;
英文生效的messages_en_US.properties;
繁体生效的messages_zh_TW.properties;
- 在resources新建一个名叫“i18n”的包,我们用来存放国际化配置;


- 2、点击messages.properties,然后点击下边如图所示的Resource Bundle的按钮,切换编辑模式:

参考链接
解决 IntelliJ IDEA 中 i18n国际化 中文乱码问题。
Idea国际化中文properties内容显示
SpringBoot日记——国际化篇
网友评论