类 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

        public I18nUtils()
    • 方法详细资料

      • isSystemWin

        public static boolean isSystemWin()
      • loadCommonLanguage

        public static void loadCommonLanguage​(String defaultLanguage)
      • loadLanguage

        public static void loadLanguage​(Class c,
                                        String folder,
                                        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