|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.sal.core.message.AbstractI18nResolver
public abstract class AbstractI18nResolver
Basic skeleton of an implementation of I18nResolver, which host applications can use to get started.
Subclasses should only need to implement the abstract methods resolveText(String, java.io.Serializable[])
and resolveText(Locale, String, Serializable[]).
| Constructor Summary | |
|---|---|
AbstractI18nResolver()
|
|
| Method Summary | |
|---|---|
Message |
createMessage(String key,
Serializable... arguments)
Creates an instance of Message. |
MessageCollection |
createMessageCollection()
|
String |
getText(Locale locale,
Message message)
Given a Message this method:
returns the i18ned text formatted with the message arguments if the message key can be resolved.
Otherwise, returns the message key (formatted with the message arguments).
|
String |
getText(Locale locale,
String key)
Does the same as I18nResolver.getText(Locale, String, java.io.Serializable...) however it is needed for velocity. |
String |
getText(Locale locale,
String key,
Serializable... arguments)
Given a key and a list of arguments: this method returns the i18ned text formatted with the arguments if the key can be resolved. otherwise, the key itself will be returned (after formatting). Arguments may also be of the form Message which means they will be resolved as well before
being included as an argument. |
String |
getText(Message message)
Given a Message this method:
returns the i18ned text formatted with the message arguments if the message key can be resolved.
Otherwise, returns the message key (formatted with the message arguments).
Uses the default locale. |
String |
getText(String key)
Does the same as I18nResolver.getText(String, java.io.Serializable...) however it is needed for velocity. |
String |
getText(String key,
Serializable... arguments)
Given a key and a list of arguments: this method returns the i18ned text formatted with the arguments if the key can be resolved. otherwise, the key itself will be returned (after formatting). Arguments may also be of the form Message which means they will be resolved as well before
being included as an argument. |
abstract String |
resolveText(Locale locale,
String key,
Serializable[] arguments)
Subclasses should implement this method to dispatch to a matching language in the given locale. |
abstract String |
resolveText(String key,
Serializable[] arguments)
Subclasses should implement this method to dispatch to a matching language in (in order of preference): the user's locale the application's configured locale, or the system default locale |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.atlassian.sal.api.message.I18nResolver |
|---|
getAllTranslationsForPrefix, getAllTranslationsForPrefix, getRawText |
| Constructor Detail |
|---|
public AbstractI18nResolver()
| Method Detail |
|---|
public String getText(String key,
Serializable... arguments)
I18nResolverMessage which means they will be resolved as well before
being included as an argument. Uses the default locale.
getText in interface I18nResolverkey - key for the i18ned messagearguments - Optional list of arguments for the message.
public String getText(Locale locale,
String key,
Serializable... arguments)
I18nResolverMessage which means they will be resolved as well before
being included as an argument.
getText in interface I18nResolverlocale - the locale to use for the i18ned textkey - key for the i18ned messagearguments - Optional list of arguments for the message.
public String getText(String key)
I18nResolverI18nResolver.getText(String, java.io.Serializable...) however it is needed for velocity.
getText in interface I18nResolverkey - key for the i18ned message
public String getText(Locale locale,
String key)
I18nResolverI18nResolver.getText(Locale, String, java.io.Serializable...) however it is needed for velocity.
getText in interface I18nResolverlocale - the locale to use for the i18ned textkey - key for the i18ned message
public String getText(Message message)
I18nResolverMessage this method:
getText in interface I18nResolvermessage - The message to i18n
public String getText(Locale locale,
Message message)
I18nResolverMessage this method:
getText in interface I18nResolverlocale - the locale to use for the i18ned textmessage - The message to i18n
public abstract String resolveText(String key,
Serializable[] arguments)
key - the key to translate.arguments - the arguments to be inserted into the translated string.
public abstract String resolveText(Locale locale,
String key,
Serializable[] arguments)
locale - the locale to translate into.key - the key to translate.arguments - the arguments to be inserted into the translated string.
public Message createMessage(String key,
Serializable... arguments)
I18nResolver
createMessage in interface I18nResolverkey - The message keyarguments - The arguments to interpolate
public MessageCollection createMessageCollection()
createMessageCollection in interface I18nResolver
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||