类 I18nUtils
- java.lang.Object
-
- network.nerve.core.parse.I18nUtils
-
public class I18nUtils extends Object
国际化工具,可以根据系统设置的语言把信息编码转换为可读的不同语言的字符串 Internationalized tools can convert information encoding into a readable string of different languages, depending on the language set by the system.- 作者:
- tag
-
-
构造器概要
构造器 构造器 说明 I18nUtils()
-
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static Stringget(String id)根据信息编码获取一条翻译后的消息体 Obtain a translated message body based on the information encoding.static Map<String,Properties>getAll()static StringgetLanguage()获取当前系统已设置的语言标识 Gets the language id that the current system has set.static booleanhasLanguage(String lang)判断是否已加载某个语言包 Determines whether a language package has been loaded.static booleanisSystemWin()static voidloadCommonLanguage(String defaultLanguage)static voidloadLanguage(Class c, String folder, String defaultLanguage)static voidsetLanguage(String lang)设置系统语言,切换语言包 Set up the system language and switch the language package.
-
-
-
方法详细资料
-
isSystemWin
public static boolean isSystemWin()
-
loadCommonLanguage
public static void loadCommonLanguage(String defaultLanguage)
-
setLanguage
public static void setLanguage(String lang) throws NulsException
设置系统语言,切换语言包 Set up the system language and switch the language package.- 参数:
lang- 语言标识/Language identification- 抛出:
NulsException
-
get
public static String get(String id)
根据信息编码获取一条翻译后的消息体 Obtain a translated message body based on the information encoding.- 参数:
id- 信息编码- 返回:
- String 翻译后的字符串/The translated string.
-
hasLanguage
public static boolean hasLanguage(String lang)
判断是否已加载某个语言包 Determines whether a language package has been loaded.- 参数:
lang- 语言标识/Language identification- 返回:
- 判断结果/Determine the results
-
getLanguage
public static String getLanguage()
获取当前系统已设置的语言标识 Gets the language id that the current system has set.- 返回:
- String 语言标识/Language identification
-
getAll
public static Map<String,Properties> getAll()
-
-