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 boolean
equals(Object obj)
String
getCapitalDisplayLanguage()
String
getCapitalDisplayName()
String
getCountry()
String
getDisplayLanguage()
Returns the name of the Language in its locale formString
getDisplayName()
Returns the name for the Locale that is appropriate to display to the userString
getDisplayName(boolean shortCountry)
Returns the name for the Locale that is appropriate to display to the userString
getEncoding()
String
getFlagUrl()
Returns the URL of the flag for this languageString
getJsLang()
Returns JS representation of current language.static String
getJsLang(String langStr)
Returns JS representation of the language.String
getLanguage()
Locale
getLocale()
String
getName()
Returns the name of the LanguageString
getResourceBundlePath()
int
hashCode()
void
setCountry(String country)
void
setEncoding(String encoding)
void
setFlagUrl(String flagUrl)
Sets the URL of the flag for this languagevoid
setLanguage(String language)
void
setLocale(Locale locale)
String
setVariant()
void
setVariant(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
-
-