ResourceBundle bundle = ResourceBundle.getBundle("myApp");
** 默认读取根目录下myApp.properties **
- 英文(读取myApp_en.properties)
ResourceBundle bundle = ResourceBundle.getBundle("myApp", Locale.ENGLISH);
String nameEng = bundle.getString("name");
- 中文(读取myApp_ch.properties)
ResourceBundle bundle = ResourceBundle.getBundle("myApp", Locale.CHINA);
String nameChn = bundle.getString("name");
网友评论