Class Language
- java.lang.Object
-
- com.atlassian.confluence.languages.Language
-
- All Implemented Interfaces:
Serializable
public class Language extends Object implements Serializable
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Language(LanguageModuleDescriptor moduleDescriptor)Language(Locale locale)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)StringgetCapitalDisplayLanguage()StringgetCapitalDisplayName()StringgetCountry()StringgetDisplayLanguage()Returns the name of the Language in its locale formStringgetDisplayName()Returns the name for the Locale that is appropriate to display to the userStringgetDisplayName(boolean shortCountry)Returns the name for the Locale that is appropriate to display to the userStringgetEncoding()StringgetFlagUrl()Returns the URL of the flag for this languageStringgetJsLang()Returns JS representation of current language.static StringgetJsLang(String langStr)Returns JS representation of the language.StringgetLanguage()LocalegetLocale()StringgetName()Returns the name of the LanguageStringgetResourceBundlePath()inthashCode()voidsetCountry(String country)voidsetEncoding(String encoding)voidsetFlagUrl(String flagUrl)Sets the URL of the flag for this languagevoidsetLanguage(String language)voidsetLocale(Locale locale)StringsetVariant()voidsetVariant(String variant)
-
-
-
Constructor Detail
-
Language
public Language(Locale locale)
-
Language
public Language(LanguageModuleDescriptor moduleDescriptor)
-
-
Method Detail
-
getName
public String getName()
Returns the name of the Language- Returns:
- The output of locale.toString()
- See Also:
Locale.toString()
-
getDisplayLanguage
public String getDisplayLanguage()
Returns the name of the Language in its locale form- Returns:
- The output of locale.getDisplayLanguage(locale)
- See Also:
Locale.getDisplayLanguage()
-
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:
Locale.getDisplayName()
-
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:
Locale.getDisplayName()
-
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 languageNote: 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 languageNote: 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()
-
getJsLang
public String getJsLang()
Returns JS representation of current language.- Returns:
- String with JS representation of language + locale
-
-