📄 resourcesbundle.java
字号:
package com.easyjf.i18n;
import java.util.Enumeration;
import java.util.Locale;
import java.util.ResourceBundle;
/**
* @author WilliamRaym
*
* $Id: ResourcesBundle.java,v 1.0 2:22 2007-8-18 EasyJWeb ResourcesBundle
* handler Exp $
*
* @see <code>ResourceBundle</code>
* <ul>
* <li>ResourceBundle getString(String key)</li>
* <li>...</li>
* </ul>
* @see http://ftp.ics.uci.edu/pub/ietf/http/related/iso639.txt
* @see http://userpage.chemie.fu-berlin.de/diverse/doc/ISO_3166.html
* @version 1.0
*/
public class ResourcesBundle {
/**
* 在本静态方法中加载Globals中定义的属性文件和语言 默认为中文
*/
private static ResourceBundle rb;
static {
String lp = com.easyjf.web.Globals.LANGUAGE_PROPERTIES;
Locale locale = com.easyjf.web.Globals.LANGUAGE;
if (lp == null || "".equals(lp)) {
lp = "com.easyjf.web.resources.easyjweb";
}
if (locale == null || "".equals(locale)) {
locale = new Locale("zh", "CN");
}
rb = ResourceBundle.getBundle(lp, locale);
}
public static Enumeration<String> getKeys() {
return rb.getKeys();
}
public static Locale getLocale() {
return rb.getLocale();
}
public static Object getObject(String key) {
return rb.getObject(key);
}
public static String[] getStringArray(String key) {
return rb.getStringArray(key);
}
@SuppressWarnings("static-access")
public static ResourceBundle getBundle(String baseName) {
return rb.getBundle(baseName);
}
@SuppressWarnings("static-access")
public static ResourceBundle getBundle(String baseName, Locale locale) {
return rb.getBundle(baseName, locale);
}
@SuppressWarnings("static-access")
public static ResourceBundle getBundle(String baseName, Locale locale,
ClassLoader loader) {
return rb.getBundle(baseName, locale, loader);
}
public static String getString(String key) {
return rb.getString(key);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -