|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.starteam.Translations
public final class Translations
The Translations class defines the possible localized translations of a particular resource. There is the notion of a default translation which should be used when no translation exists for a particular language. In addition to the default there may be any number of specific localizations defined on a per-locale basis.
| Field Summary | |
|---|---|
static Translations |
FALSE
Known translations of "false". |
static Translations |
NO
Known translations of "no". |
static Translations |
OFF
Known translations of "off". |
static Translations |
ON
Known translations of "on". |
static Translations |
TRUE
Known translations of "true". |
static Translations |
YES
Known translations of "yes". |
| Constructor Summary | |
|---|---|
Translations()
Create a new Translations object with only a default set to the empty string. |
|
Translations(java.lang.String defaultValue)
Create a new Translations object with the default set to the specified string. |
|
| Method Summary | |
|---|---|
java.util.Locale |
closestDefined(java.util.Locale locale)
The closest locale defined for the specified locale |
Translations |
copy()
Makes a copy of the specified translation |
boolean |
equals(java.lang.Object o)
compare two Translations for equality |
java.lang.String |
getDebugString()
return a string representation of the Locale, useful for debugging |
java.lang.String |
getDefault()
Return the default translation. |
java.lang.String[] |
getLocaleNames()
Return all of the locale names for which a translation exists. |
java.util.Locale[] |
getLocales()
Return all of the locales for which a translation exists. |
java.lang.String |
getTranslation(java.util.Locale locale)
Return the translation for the specified locale. |
java.lang.String |
getTranslation(java.lang.String locale)
Return the translation for the specified locale. |
int |
hashCode()
returns a unique hash for this instance |
boolean |
isEqualTo(Translations other)
compares two translations |
static java.util.Locale |
parseLocale(java.lang.String pattern)
Parse the locale pattern and return the corresponding locale. |
void |
removeLocale(java.util.Locale locale)
Remove the translation for the specified locale. |
void |
removeLocale(java.lang.String locale)
Remove this the translation for the specified locale. |
void |
setDefault(java.lang.String value)
Change the default translation. |
java.lang.String |
setTranslation(java.util.Locale locale,
java.lang.String value)
Create or modify an existing translation. |
java.lang.String |
setTranslation(java.lang.String locale,
java.lang.String value)
Create or modify an existing translation. |
java.lang.String |
toString()
return a string representation of the Locale, useful for debugging |
static java.lang.String |
toString(java.util.Locale locale)
Returns a string prepresentation of the specified locale. |
java.lang.String |
translate()
Returns the most appropriate translation for this resource based on the default locale. |
java.lang.String |
translate(java.util.Locale locale)
Returns the most appropriate translation for this resource for the specified locale. |
java.lang.String |
translate(java.lang.String locale)
Returns the most appropriate translation for this resource for the specified locale. |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final Translations TRUE
public static final Translations FALSE
public static final Translations YES
public static final Translations NO
public static final Translations ON
public static final Translations OFF
| Constructor Detail |
|---|
public Translations()
public Translations(java.lang.String defaultValue)
defaultValue - the default display name. May not be null.| Method Detail |
|---|
public java.lang.String getDefault()
public void setDefault(java.lang.String value)
value - the new default translation, may not be null.public java.util.Locale[] getLocales()
public java.lang.String[] getLocaleNames()
public void removeLocale(java.util.Locale locale)
locale - the locale to be removedpublic void removeLocale(java.lang.String locale)
locale - the locale to be removed
public java.lang.String setTranslation(java.util.Locale locale,
java.lang.String value)
locale - the locale for the new translationvalue - the locale specific translation
public java.lang.String setTranslation(java.lang.String locale,
java.lang.String value)
locale - the locale for the new translationvalue - the locale specific translation
public java.lang.String getTranslation(java.util.Locale locale)
locale - the locale of the desired translation. May not be null.
public java.lang.String getTranslation(java.lang.String locale)
locale - the locale of the desired translation. May not be null.
public java.lang.String translate(java.util.Locale locale)
locale - the locale of the desired translation. A null value will
return the default translation.Translations.getDefault()public java.util.Locale closestDefined(java.util.Locale locale)
locale - the specified locale
public java.lang.String translate(java.lang.String locale)
locale - the locale of the desired translation. A null value will
return the default translation.public java.lang.String translate()
Locale.getDefault()public static java.lang.String toString(java.util.Locale locale)
locale - the locale. A null parameter will return the empty string.public static java.util.Locale parseLocale(java.lang.String pattern)
pattern - the locale pattern. A null pattern will return the "invariant"
locale (language="", country="", variant="")
public java.lang.String getDebugString()
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objecto - the other Translation
public int hashCode()
hashCode in class java.lang.Objectpublic boolean isEqualTo(Translations other)
other - the other translation
public Translations copy()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||