MockI18nHelper
(in the right package),
NoopI18nHelper
, or Mockito mocks instead@Deprecated public class MockI18nHelper extends Object implements I18nHelper
I18nHelper.BeanFactory
Constructor and Description |
---|
MockI18nHelper()
Deprecated.
|
MockI18nHelper(Locale locale)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
ResourceBundle |
getDefaultResourceBundle()
Deprecated.
Returns the default
ResourceBundle within JIRA, which does not include translations provided by plugins. |
Set<String> |
getKeysForPrefix(String prefix)
Deprecated.
Given a prefix for an i18n key, this method will return all keys that start with the prefix specified.
|
Locale |
getLocale()
Deprecated.
|
ResourceBundle |
getResourceBundle()
Deprecated.
Returns the consolidated ResourceBundle for this I18nHelper, which includes translations provided by plugins.
|
String |
getText(String key)
Deprecated.
Called to return the formatted text of the specified i18n key or the key itself if no message can be found
|
String |
getText(String key,
Object parameter)
Deprecated.
Called to return the formatted text of the specified i18n key or the key itself if no message can be found.
|
String |
getText(String key,
Object value1,
Object value2,
Object value3)
Deprecated.
Called to return the formatted text of the specified i18n key or the key itself if no message can be found
|
String |
getText(String key,
Object value1,
Object value2,
Object value3,
Object value4)
Deprecated.
Called to return the formatted text of the specified i18n key or the key itself if no message can be found
|
String |
getText(String key,
Object value1,
Object value2,
Object value3,
Object value4,
Object value5)
Deprecated.
Called to return the formatted text of the specified i18n key or the key itself if no message can be found
|
String |
getText(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 found
|
String |
getText(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 found
|
String |
getText(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 found
|
String |
getText(String key,
String value1)
Deprecated.
Called to return the formatted text of the specified i18n key or the key itself if no message can be found
|
String |
getText(String key,
String value1,
String value2)
Deprecated.
Called to return the formatted text of the specified i18n key or the key itself if no message can be found
|
String |
getText(String key,
String value1,
String value2,
String value3)
Deprecated.
Called to return the formatted text of the specified i18n key or the key itself if no message can be found
|
String |
getText(String key,
String value1,
String value2,
String value3,
String value4)
Deprecated.
Called to return the formatted text of the specified i18n key or the key itself if no message can be found
|
String |
getText(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 key
|
String |
getText(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 found
|
String |
getUnescapedText(String key)
Deprecated.
Called to return the un-formatted text of the specified i18n key or the key itself if no message can be found
|
String |
getUntransformedRawText(String key)
Deprecated.
Same as
I18nHelper.getUnescapedText(String) but does not apply any TranslationTransform 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.
|
public MockI18nHelper()
public MockI18nHelper(Locale locale)
public String getText(String key)
I18nHelper
getText
in interface I18nHelper
key
- the key of the i18n messagepublic String getUnescapedText(String key)
I18nHelper
getUnescapedText
in interface I18nHelper
key
- the key of the i18n messagepublic String getUntransformedRawText(String key)
I18nHelper
I18nHelper.getUnescapedText(String)
but does not apply any TranslationTransform
s.getUntransformedRawText
in interface I18nHelper
key
- the key of the i18n messagepublic boolean isKeyDefined(String key)
I18nHelper
I18nHelper.getUntransformedRawText(String)
, whereby if this
method returns false
, I18nHelper.getUntransformedRawText(String)
will return the key provided as an
argument, and if this method returns true
, I18nHelper.getUntransformedRawText(String)
will generally
return the translation, which in some very unlikely cases may be equal to the key.isKeyDefined
in interface I18nHelper
key
- translation keytrue
, if any translation for such key exists, false
otherwisepublic Locale getLocale()
getLocale
in interface I18nHelper
Locale
that is associated with this I18nHelperpublic String getText(String key, String value1)
I18nHelper
getText
in interface I18nHelper
key
- the key of the i18n messagevalue1
- a value to be substituted into the messagepublic String getText(String key, String value1, String value2)
I18nHelper
getText
in interface I18nHelper
key
- the key of the i18n messagevalue1
- a value to be substituted into the messagevalue2
- a value to be substituted into the messagepublic String getText(String key, String value1, String value2, String value3)
I18nHelper
getText
in interface I18nHelper
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 messagepublic String getText(String key, String value1, String value2, String value3, String value4)
I18nHelper
getText
in interface I18nHelper
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 messagepublic String getText(String key, Object value1, Object value2, Object value3, Object value4, Object value5, Object value6)
I18nHelper
getText
in interface I18nHelper
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 messagepublic String getText(String key, String value1, String value2, String value3, String value4, String value5, String value6, String value7)
I18nHelper
getText
in interface I18nHelper
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 messagepublic String getText(String key, String value1, String value2, String value3, String value4, String value5, String value6, String value7, String value8, String value9)
I18nHelper
getText
in interface I18nHelper
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 messagepublic String getText(String key, Object value1, Object value2, Object value3)
I18nHelper
getText
in interface I18nHelper
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 messagepublic String getText(String key, Object value1, Object value2, Object value3, Object value4)
I18nHelper
getText
in interface I18nHelper
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 messagepublic String getText(String key, Object value1, Object value2, Object value3, Object value4, Object value5)
I18nHelper
getText
in interface I18nHelper
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 messagepublic String getText(String key, Object value1, Object value2, Object value3, Object value4, Object value5, Object value6, Object value7)
I18nHelper
getText
in interface I18nHelper
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 messagepublic String getText(String key, Object value1, Object value2, Object value3, Object value4, Object value5, Object value6, Object value7, Object value8)
I18nHelper
getText
in interface I18nHelper
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 messagepublic ResourceBundle getDefaultResourceBundle()
I18nHelper
ResourceBundle
within JIRA, which does not include translations provided by plugins.
For use cases where non-English translations are required, call I18nHelper.getResourceBundle()
instead.getDefaultResourceBundle
in interface I18nHelper
I18nHelper.getResourceBundle()
public String getText(String key, Object parameter)
I18nHelper
List
} or a single parameter object. It will be then
used as substitution parameters within the message.getText
in interface I18nHelper
key
- the key of the i18n messageparameter
- This can be an Array, a List
and Array or a single object parameterpublic Set<String> getKeysForPrefix(String prefix)
I18nHelper
getKeysForPrefix
in interface I18nHelper
prefix
- The prefix for i18n keys. May not be nullpublic ResourceBundle getResourceBundle()
I18nHelper
getResourceBundle
in interface I18nHelper
I18nHelper.getDefaultResourceBundle()
Copyright © 2002-2015 Atlassian. All Rights Reserved.