|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.starbase.starteam.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.
| 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)
|
Translations |
copy()
|
boolean |
equals(java.lang.Object source)
returns true if this object instance is equal to the source |
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 all instances of this type |
boolean |
isEqualTo(Translations other)
|
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 |
toDebugString()
|
java.lang.String |
toString()
|
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 |
| 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)
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 toDebugString()
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean isEqualTo(Translations other)
public Translations copy()
public boolean equals(java.lang.Object source)
equals in class java.lang.Objectsource - Object the source to comapre with
public int hashCode()
hashCode in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||