Class LanguageUtil

java.lang.Object
com.day.cq.commons.LanguageUtil

public class LanguageUtil extends Object
LanguageUtil...
  • Field Details

  • Constructor Details

    • LanguageUtil

      public LanguageUtil()
  • Method Details

    • 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