Class LanguageUtil


  • public class LanguageUtil
    extends Object
    LanguageUtil...
    • Constructor Detail

      • LanguageUtil

        public LanguageUtil()
    • Method Detail

      • getLocale

        public static Locale getLocale​(String code)
        Returns the language locale for the given language/country abbreviation.
        Parameters:
        code - the language/country code. eg de_CH
        Returns:
        the locale or null if not valid.
      • getLanguage

        public static Language getLanguage​(String code)
        Returns the language for the given language/country abbreviation.
        Parameters:
        code - the language/country code. eg de_CH or de-CH
        Returns:
        the locale or null if not valid.
        Since:
        5.4
      • getLanguageRoot

        public static String getLanguageRoot​(String path)
        Returns the language root for the given path by only analyzing the path names starting at the root.
        Parameters:
        path - path
        Returns:
        the language root or null if not found