com.atlassian.confluence.util.i18n
Class I18NBean

java.lang.Object
  extended bycom.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)


Field Summary
static String DEFAULT_RESOURCE_BUNDLE
           
static String HIGHLIGHT
           
static org.apache.log4j.Category log
           
static String SHOWKEY
           
 
Constructor Summary
I18NBean(Locale locale, PluginManager pluginManager)
           
 
Method Summary
 ResourceBundle getResourceBundle()
           
 String getText(String key)
          Get the i18n text for a particular key.
 String getText(String key, List list)
           
 String getText(String key, Object[] args)
          Get the i18n text for a particular key, formatted through MessageFormat with the given arguments.
 String getTextStrict(String i18nKey)
          Needed for text that should not be marked up (for example, values for the 'accessKey' attribute in an input element)
 boolean isI18nHighlightMode()
           
 boolean isShowKeyMode()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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
Constructor Detail

I18NBean

public I18NBean(Locale locale,
                PluginManager pluginManager)
Method Detail

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 for
args - 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()


Confluence is developed by Atlassian.