频道栏目
IT货架 > > 正文
ResourceBundle加载资料的顺序
网友分享于:Jun 12, 2018 10:45:36 PM    来源: IT货架   
ResourceBundle加载文件的顺序

If a ResourceBundle class for the specified Locale does not exist, getBundle tries to find the closest match. For example, if ButtonLabel_fr_CA_UNIX is the desired class and the default Locale is en_US , getBundle will look for classes in the following order:

ButtonLabel_fr_CA_UNIX
ButtonLabel_fr_CA
ButtonLabel_fr
ButtonLabel_en_US
ButtonLabel_en
ButtonLabel

Note that getBundle looks for classes based on the default Locale before it selects the base class (ButtonLabel) . If getBundle fails to find a match in the preceding list of classes, it throws a MissingResourceException . To avoid throwing this exception, you should always provide a base class with no suffixes.

 

http://docs.oracle.com/javase/tutorial/i18n/resbundle/concept.html

 

广告服务联系QQ:1134687142 | 网站地图

版权所有: IT货架- 内容来自互联网,仅供用于技术学习,请遵循相关法律法规. 京ICP备11030978号-1