能够直接经过官方的描述来了解 https://www.jetbrains.com/hel...html
Resource bundle is a set of properties files that have same base name with different language-specific suffixes. A resource bundle contains at least two properties files with similar base name, for example file_en.properties and file_de.properties.
官方的描述是一堆有着相同前缀名称但有着不一样语言后缀名称的属性文件的集合,且至少包含2个有着类似前缀名称的属性文件,例如file_en.properties
和file_de.properties
其实从字面上理解就是资源包,为了方便统一管理繁多的国际化文件java
Resource Bundle的目录结构ide
只是在Intellij IDEA内显示上多了一层名为Resources的Resource Bundle目录,但在实际物理目录下Resources*.properties
等文件仍在java-calculator目录下工具
Alt + 1
打开项目工具窗口,选中要建立Resource Bundle的目录Alt + Insert
- Resource Bundle+
号便可添加,多个区域用,
隔开点击+
号添加多个区域,这里以添加zh和en为例idea
添加完成后,能够在Locales to add看到已经添加的区域spa
点击OK生成Resource Bundlecode
Add Property Files to Resource Bundle
,点击+
添加新的区域便可生成新的属性文件Dissociate Resource Bundle 'demo'
Ctrl + 鼠标左键
选中多个属性文件后右键 - Combine to Resource Bundle