Class MockI18nHelper
- All Implemented Interfaces:
I18nHelper
- Since:
- v3.12
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.atlassian.jira.util.I18nHelper
I18nHelper.BeanFactory
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionDeprecated.Returns the defaultResourceBundle
within JIRA, which does not include translations provided by plugins.getKeysForPrefix
(String prefix) Deprecated.Given a prefix for an i18n key, this method will return all keys that start with the prefix specified.Deprecated.Deprecated.Returns the consolidated ResourceBundle for this I18nHelper, which includes translations provided by plugins.Deprecated.Called to return the formatted text of the specified i18n key or the key itself if no message can be foundDeprecated.Called to return the formatted text of the specified i18n key or the key itself if no message can be found.Deprecated.Called to return the formatted text of the specified i18n key or the key itself if no message can be foundDeprecated.Called to return the formatted text of the specified i18n key or the key itself if no message can be foundDeprecated.Called to return the formatted text of the specified i18n key or the key itself if no message can be foundgetText
(String key, Object value1, Object value2, Object value3, Object value4, Object value5, Object value6) Deprecated.Called to return the formatted text of the specified i18n key or the key itself if no message can be foundgetText
(String key, Object value1, Object value2, Object value3, Object value4, Object value5, Object value6, Object value7) Deprecated.Called to return the formatted text of the specified i18n key or the key itself if no message can be foundgetText
(String key, Object value1, Object value2, Object value3, Object value4, Object value5, Object value6, Object value7, Object value8) Deprecated.Called to return the formatted text of the specified i18n key or the key itself if no message can be foundDeprecated.Called to return the formatted text of the specified i18n key or the key itself if no message can be foundDeprecated.Called to return the formatted text of the specified i18n key or the key itself if no message can be foundDeprecated.Called to return the formatted text of the specified i18n key or the key itself if no message can be foundDeprecated.Called to return the formatted text of the specified i18n key or the key itself if no message can be foundgetText
(String key, String value1, String value2, String value3, String value4, String value5, String value6, String value7) Deprecated.Called to return the formatted text of the specified i18n keygetText
(String key, String value1, String value2, String value3, String value4, String value5, String value6, String value7, String value8, String value9) Deprecated.Called to return the formatted text of the specified i18n key or the key itself if no message can be foundgetUnescapedText
(String key) Deprecated.Called to return the un-formatted text of the specified i18n key or the key itself if no message can be foundDeprecated.Same asI18nHelper.getUnescapedText(String)
but does not apply anyTranslationTransform
s.boolean
isKeyDefined
(String key) Deprecated.For the given key, checks whether such a key is defined in the locale context represented by this helper instance.
-
Constructor Details
-
MockI18nHelper
public MockI18nHelper()Deprecated. -
MockI18nHelper
Deprecated.
-
-
Method Details
-
getText
Deprecated.Description copied from interface:I18nHelper
Called to return the formatted text of the specified i18n key or the key itself if no message can be found- Specified by:
getText
in interfaceI18nHelper
- Parameters:
key
- the key of the i18n message- Returns:
- the formatted text or the key itself if no i18n message can be found
-
getUnescapedText
Deprecated.Description copied from interface:I18nHelper
Called to return the un-formatted text of the specified i18n key or the key itself if no message can be found- Specified by:
getUnescapedText
in interfaceI18nHelper
- Parameters:
key
- the key of the i18n message- Returns:
- the un-formatted, translated, text or the key itself if no i18n message can be found
-
getUntransformedRawText
Deprecated.Description copied from interface:I18nHelper
Same asI18nHelper.getUnescapedText(String)
but does not apply anyTranslationTransform
s.- Specified by:
getUntransformedRawText
in interfaceI18nHelper
- Parameters:
key
- the key of the i18n message- Returns:
- the un-formatted text or the key itself if no i18n message can be found
-
isKeyDefined
Deprecated.Description copied from interface:I18nHelper
For the given key, checks whether such a key is defined in the locale context represented by this helper instance. Note that the actual translation may be in the 'fallback' default locale rather than the current locale.
The contract of this is method is correlated with
I18nHelper.getUntransformedRawText(String)
, whereby if this method returnsfalse
,I18nHelper.getUntransformedRawText(String)
will return the key provided as an argument, and if this method returnstrue
,I18nHelper.getUntransformedRawText(String)
will generally return the translation, which in some very unlikely cases may be equal to the key.- Specified by:
isKeyDefined
in interfaceI18nHelper
- Parameters:
key
- translation key- Returns:
true
, if any translation for such key exists,false
otherwise
-
getLocale
Deprecated.- Specified by:
getLocale
in interfaceI18nHelper
- Returns:
- the
Locale
that is associated with this I18nHelper
-
getText
Deprecated.Description copied from interface:I18nHelper
Called to return the formatted text of the specified i18n key or the key itself if no message can be found- Specified by:
getText
in interfaceI18nHelper
- Parameters:
key
- the key of the i18n messagevalue1
- a value to be substituted into the message- Returns:
- the formatted text or the key itself if no i18n message can be found
-
getText
Deprecated.Description copied from interface:I18nHelper
Called to return the formatted text of the specified i18n key or the key itself if no message can be found- Specified by:
getText
in interfaceI18nHelper
- Parameters:
key
- the key of the i18n messagevalue1
- a value to be substituted into the messagevalue2
- a value to be substituted into the message- Returns:
- the formatted text or the key itself if no i18n message can be found
-
getText
Deprecated.Description copied from interface:I18nHelper
Called to return the formatted text of the specified i18n key or the key itself if no message can be found- Specified by:
getText
in interfaceI18nHelper
- Parameters:
key
- the key of the i18n messagevalue1
- a value to be substituted into the messagevalue2
- a value to be substituted into the messagevalue3
- a value to be substituted into the message- Returns:
- the formatted text or the key itself if no i18n message can be found
-
getText
Deprecated.Description copied from interface:I18nHelper
Called to return the formatted text of the specified i18n key or the key itself if no message can be found- Specified by:
getText
in interfaceI18nHelper
- Parameters:
key
- the key of the i18n messagevalue1
- a value to be substituted into the messagevalue2
- a value to be substituted into the messagevalue3
- a value to be substituted into the messagevalue4
- a value to be substituted into the message- Returns:
- the formatted text or the key itself if no i18n message can be found
-
getText
public String getText(String key, Object value1, Object value2, Object value3, Object value4, Object value5, Object value6) Deprecated.Description copied from interface:I18nHelper
Called to return the formatted text of the specified i18n key or the key itself if no message can be found- Specified by:
getText
in interfaceI18nHelper
- Parameters:
key
- the key of the i18n messagevalue1
- a value to be substituted into the messagevalue2
- a value to be substituted into the messagevalue3
- a value to be substituted into the messagevalue4
- a value to be substituted into the messagevalue5
- a value to be substituted into the messagevalue6
- a value to be substituted into the message- Returns:
- the formatted text or the key itself if no i18n message can be found
-
getText
public String getText(String key, String value1, String value2, String value3, String value4, String value5, String value6, String value7) Deprecated.Description copied from interface:I18nHelper
Called to return the formatted text of the specified i18n key- Specified by:
getText
in interfaceI18nHelper
- Parameters:
key
- the key of the i18n messagevalue1
- a value to be substituted into the messagevalue2
- a value to be substituted into the messagevalue3
- a value to be substituted into the messagevalue4
- a value to be substituted into the messagevalue5
- a value to be substituted into the messagevalue6
- a value to be substituted into the messagevalue7
- a value to be substituted into the message- Returns:
- the formatted text or the key itself if no i18n message can be found
-
getText
public String getText(String key, String value1, String value2, String value3, String value4, String value5, String value6, String value7, String value8, String value9) Deprecated.Description copied from interface:I18nHelper
Called to return the formatted text of the specified i18n key or the key itself if no message can be found- Specified by:
getText
in interfaceI18nHelper
- Parameters:
key
- the key of the i18n messagevalue1
- a value to be substituted into the messagevalue2
- a value to be substituted into the messagevalue3
- a value to be substituted into the messagevalue4
- a value to be substituted into the messagevalue5
- a value to be substituted into the messagevalue6
- a value to be substituted into the messagevalue7
- a value to be substituted into the messagevalue8
- a value to be substituted into the messagevalue9
- a value to be substituted into the message- Returns:
- the formatted text or the key itself if no i18n message can be found
-
getText
Deprecated.Description copied from interface:I18nHelper
Called to return the formatted text of the specified i18n key or the key itself if no message can be found- Specified by:
getText
in interfaceI18nHelper
- Parameters:
key
- the key of the i18n messagevalue1
- a value to be substituted into the messagevalue2
- a value to be substituted into the messagevalue3
- a value to be substituted into the message- Returns:
- the formatted text or the key itself if no i18n message can be found
-
getText
Deprecated.Description copied from interface:I18nHelper
Called to return the formatted text of the specified i18n key or the key itself if no message can be found- Specified by:
getText
in interfaceI18nHelper
- Parameters:
key
- the key of the i18n messagevalue1
- a value to be substituted into the messagevalue2
- a value to be substituted into the messagevalue3
- a value to be substituted into the messagevalue4
- a value to be substituted into the message- Returns:
- the formatted text or the key itself if no i18n message can be found
-
getText
public String getText(String key, Object value1, Object value2, Object value3, Object value4, Object value5) Deprecated.Description copied from interface:I18nHelper
Called to return the formatted text of the specified i18n key or the key itself if no message can be found- Specified by:
getText
in interfaceI18nHelper
- Parameters:
key
- the key of the i18n messagevalue1
- a value to be substituted into the messagevalue2
- a value to be substituted into the messagevalue3
- a value to be substituted into the messagevalue4
- a value to be substituted into the messagevalue5
- a value to be substituted into the message- Returns:
- the formatted text or the key itself if no i18n message can be found
-
getText
public String getText(String key, Object value1, Object value2, Object value3, Object value4, Object value5, Object value6, Object value7) Deprecated.Description copied from interface:I18nHelper
Called to return the formatted text of the specified i18n key or the key itself if no message can be found- Specified by:
getText
in interfaceI18nHelper
- Parameters:
key
- the key of the i18n messagevalue1
- a value to be substituted into the messagevalue2
- a value to be substituted into the messagevalue3
- a value to be substituted into the messagevalue4
- a value to be substituted into the messagevalue5
- a value to be substituted into the messagevalue6
- a value to be substituted into the messagevalue7
- a value to be substituted into the message- Returns:
- the formatted text or the key itself if no i18n message can be found
-
getText
public String getText(String key, Object value1, Object value2, Object value3, Object value4, Object value5, Object value6, Object value7, Object value8) Deprecated.Description copied from interface:I18nHelper
Called to return the formatted text of the specified i18n key or the key itself if no message can be found- Specified by:
getText
in interfaceI18nHelper
- Parameters:
key
- the key of the i18n messagevalue1
- a value to be substituted into the messagevalue2
- a value to be substituted into the messagevalue3
- a value to be substituted into the messagevalue4
- a value to be substituted into the messagevalue5
- a value to be substituted into the messagevalue6
- a value to be substituted into the messagevalue7
- a value to be substituted into the messagevalue8
- a value to be substituted into the message- Returns:
- the formatted text or the key itself if no i18n message can be found
-
getDefaultResourceBundle
Deprecated.Description copied from interface:I18nHelper
Returns the defaultResourceBundle
within JIRA, which does not include translations provided by plugins. For use cases where non-English translations are required, callI18nHelper.getResourceBundle()
instead.- Specified by:
getDefaultResourceBundle
in interfaceI18nHelper
- Returns:
- a non-null bundle
- See Also:
-
getText
Deprecated.Description copied from interface:I18nHelper
Called to return the formatted text of the specified i18n key or the key itself if no message can be found.The object passed in can be an array, a
List
} or a single parameter object. It will be then used as substitution parameters within the message.- Specified by:
getText
in interfaceI18nHelper
- Parameters:
key
- the key of the i18n messageparameter
- This can be an Array, aList
and Array or a single object parameter- Returns:
- the formatted text or the key itself if no i18n message can be found
-
getKeysForPrefix
Deprecated.Description copied from interface:I18nHelper
Given a prefix for an i18n key, this method will return all keys that start with the prefix specified.- Specified by:
getKeysForPrefix
in interfaceI18nHelper
- Parameters:
prefix
- The prefix for i18n keys. May not be null- Returns:
- An immutable set of translation keys that start with the prefix specified.
-
getResourceBundle
Deprecated.Description copied from interface:I18nHelper
Returns the consolidated ResourceBundle for this I18nHelper, which includes translations provided by plugins.- Specified by:
getResourceBundle
in interfaceI18nHelper
- Returns:
- a non-null bundle
- See Also:
-
MockI18nHelper
(in the right package),NoopI18nHelper
, or Mockito mocks instead