Class Language

java.lang.Object
com.atlassian.confluence.languages.Language
All Implemented Interfaces:
Serializable

public class Language extends Object implements Serializable
See Also:
  • Constructor Details

  • Method Details

    • getName

      public String getName()
      Returns the name of the Language
      Returns:
      The output of locale.toString()
      See Also:
    • getDisplayLanguage

      public String getDisplayLanguage()
      Returns the name of the Language in its locale form
      Returns:
      The output of locale.getDisplayLanguage(locale)
      See Also:
    • getDisplayName

      public String getDisplayName()
      Returns the name for the Locale that is appropriate to display to the user
      Returns:
      The output of locale.getDisplayName(locale)
      See Also:
    • getDisplayName

      public String getDisplayName(boolean shortCountry)
      Returns the name for the Locale that is appropriate to display to the user
      Parameters:
      shortCountry - if true, returns "UK" instead of "United Kingdom" and "US" instead of "United States"
      Returns:
      The output of locale.getDisplayName(locale)
      See Also:
    • getEncoding

      public String getEncoding()
    • setEncoding

      public void setEncoding(String encoding)
    • setLanguage

      public void setLanguage(String language)
    • getLanguage

      public String getLanguage()
    • setCountry

      public void setCountry(String country)
    • getCountry

      public String getCountry()
    • setVariant

      public void setVariant(String variant)
    • setVariant

      public String setVariant()
    • getLocale

      public Locale getLocale()
    • setLocale

      public void setLocale(Locale locale)
    • getFlagUrl

      public String getFlagUrl()
      Returns the URL of the flag for this language

      Note: This URL does not contain the context path or base URL of the Confluence installation

      Returns:
      String representing the URL
    • setFlagUrl

      public void setFlagUrl(String flagUrl)
      Sets the URL of the flag for this language

      Note: This URL should not contain the context path or base URL of the Confluence installation

      Parameters:
      flagUrl -
    • getResourceBundlePath

      public String getResourceBundlePath()
    • getCapitalDisplayLanguage

      public String getCapitalDisplayLanguage()
    • getCapitalDisplayName

      public String getCapitalDisplayName()
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • getJsLang

      public String getJsLang()
      Returns JS representation of current language.
      Returns:
      String with JS representation of language + locale
    • getJsLang

      public static String getJsLang(String langStr)
      Returns JS representation of the language. Examples: "en-GB", "en-US", "pt-BR". NOTE: "no_NO" should be "nn".
      Parameters:
      langStr - String
      Returns:
      String with JS representation of language + locale