Idea国际化

作者: kakukeme | 来源:发表于2019-05-17 18:31 被阅读0次

    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。

    p0.jpg

    3、国际化配置操作

      1. 在resources新建一个名叫“i18n”的包,我们用来存放国际化配置;
        默认生效的messages.properties
        中文生效的messages_zh_CN.properties;
        英文生效的messages_en_US.properties;
        繁体生效的messages_zh_TW.properties;
    p1.png p2.png
    • 2、点击messages.properties,然后点击下边如图所示的Resource Bundle的按钮,切换编辑模式:
    p3.jpg

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

    相关文章

      网友评论

        本文标题:Idea国际化

        本文链接:https://www.haomeiwen.com/subject/inuqnqtx.html