com.atlassian.confluence.util.i18n
Class I18NBean
java.lang.Object
com.atlassian.confluence.util.i18n.I18NBean
- public class I18NBean
- extends Object
Responsible for fetching interanationalised text given a key.
By default, this will only search the default resource bundle for ConfluenceActionSupport.class
To access i18n keys in resource bundles for other classes: specify these classes in a list (use fully qualified class names)
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
log
public static final org.apache.log4j.Category log
DEFAULT_RESOURCE_BUNDLE
public static final String DEFAULT_RESOURCE_BUNDLE
HIGHLIGHT
public static final String HIGHLIGHT
- See Also:
- Constant Field Values
SHOWKEY
public static final String SHOWKEY
- See Also:
- Constant Field Values
I18NBean
public I18NBean(Locale locale,
PluginManager pluginManager)
getText
public String getText(String key)
- Get the i18n text for a particular key.
getText
public String getText(String key,
Object[] args)
- Get the i18n text for a particular key, formatted through MessageFormat with the given arguments. Works
similarly to
ActionSupport.getText(String, java.util.List)
, but the array form is necessary to work well
with Velocity.
- Parameters:
key
- the key to retrieve the i18n text forargs
- an array of arguments to be passed in to the MessageFormat#format for this text
- Returns:
- the appropriate i18n text, formatted with the supplied arguments
- See Also:
ActionSupport.getText(String, java.util.List)
,
MessageFormat
getText
public String getText(String key,
List list)
getTextStrict
public String getTextStrict(String i18nKey)
- Needed for text that should not be marked up (for example, values for the 'accessKey' attribute in an input element)
- Parameters:
i18nKey
-
- Returns:
- text for i18nKey (and excludes markup regardless of settings)
getResourceBundle
public ResourceBundle getResourceBundle()
isI18nHighlightMode
public boolean isI18nHighlightMode()
isShowKeyMode
public boolean isShowKeyMode()