Class I18NBeanToMessageSourceAdapter
java.lang.Object
it.com.atlassian.confluence.license.I18NBeanToMessageSourceAdapter
- All Implemented Interfaces:
I18NBean
-
Field Summary
Fields inherited from interface com.atlassian.confluence.util.i18n.I18NBean
DEFAULT_RESOURCE_BUNDLE -
Constructor Summary
ConstructorsConstructorDescriptionI18NBeanToMessageSourceAdapter(org.springframework.context.MessageSource adaptee) I18NBeanToMessageSourceAdapter(org.springframework.context.MessageSource adaptee, Locale locale) -
Method Summary
Modifier and TypeMethodDescriptionGets the i18n text for the specified message, formatting the message's value and arguments withMessageFormat.Get the i18n text for a particular key.Get the i18n text for a particular key, formatted through MessageFormat with the given arguments.getTextStrict(String i18nKey) Needed for text that should not be marked up (for example, values for the 'accessKey' attribute in an input element)getTranslationsForPrefix(String prefix) Gets a map of all keys that start with the given prefix, and their corresponding localised text, suitable for rendering withMessageFormat.Same asI18NBean.getText(String)but does not apply anyTranslationTransforms.
-
Constructor Details
-
I18NBeanToMessageSourceAdapter
public I18NBeanToMessageSourceAdapter(org.springframework.context.MessageSource adaptee) -
I18NBeanToMessageSourceAdapter
public I18NBeanToMessageSourceAdapter(org.springframework.context.MessageSource adaptee, Locale locale)
-
-
Method Details
-
getText
Description copied from interface:I18NBeanGet the i18n text for a particular key. -
getText
Description copied from interface:I18NBeanGet the i18n text for a particular key, formatted through MessageFormat with the given arguments. Works similarly toActionSupport.getText(String, java.util.List), but the array form is necessary to work well with Velocity.- Specified by:
getTextin interfaceI18NBean- Parameters:
key- the key to retrieve the i18n text forargs- an array of arguments to be passed in to theMessageFormat.format(java.lang.Object[], java.lang.StringBuffer, java.text.FieldPosition)for this text- Returns:
- the appropriate i18n text, formatted with the supplied arguments
- See Also:
-
ActionSupport.getText(String, java.util.List)MessageFormat
-
getText
-
getText
Description copied from interface:I18NBeanGets the i18n text for the specified message, formatting the message's value and arguments withMessageFormat. -
getTextStrict
Description copied from interface:I18NBeanNeeded for text that should not be marked up (for example, values for the 'accessKey' attribute in an input element)- Specified by:
getTextStrictin interfaceI18NBean- Parameters:
i18nKey- the key to retrieve localised text for- Returns:
- text for i18nKey (and excludes markup regardless of settings)
-
getUntransformedRawText
Description copied from interface:I18NBeanSame asI18NBean.getText(String)but does not apply anyTranslationTransforms.- Specified by:
getUntransformedRawTextin interfaceI18NBean- Parameters:
key- the key of the i18n message- Returns:
- the un-formatted text or the key itself if no i18n message can be found
-
getResourceBundle
- Specified by:
getResourceBundlein interfaceI18NBean
-
getTranslationsForPrefix
Description copied from interface:I18NBeanGets a map of all keys that start with the given prefix, and their corresponding localised text, suitable for rendering withMessageFormat. It is strongly recommended that plugin developers not use this, as its performance is not guaranteed. Instead, apply translations for specific keys (e.g. via the jsI18n web resource transformer).- Specified by:
getTranslationsForPrefixin interfaceI18NBean
-