public class TranslationManagerImpl extends Object implements TranslationManager
Modifier and Type | Field and Description |
---|---|
static String |
JIRA_CF_TRANSLATION_PREFIX |
static String |
JIRA_ISSUETYPE_TRANSLATION_PREFIX |
static String |
JIRA_PRIORITY_TRANSLATION_PREFIX |
static String |
JIRA_RESOLUTION_TRANSLATION_PREFIX |
static String |
JIRA_STATUS_TRANSLATION_PREFIX |
static String |
NONE |
Constructor and Description |
---|
TranslationManagerImpl(JiraAuthenticationContext authenticationContext,
ApplicationProperties applicationProperties,
I18nHelper.BeanFactory beanFactory) |
Modifier and Type | Method and Description |
---|---|
void |
deleteCustomFieldTranslation(CustomField customField,
Locale locale) |
void |
deleteIssueConstantTranslation(IssueConstant issueConstant,
String issueConstantPrefix,
Locale locale) |
String |
getCustomFieldDescriptionTranslation(CustomField customField)
Get the translated name for the custom field or null if no translation exists.
|
String |
getCustomFieldDescriptionTranslation(CustomField customField,
Locale locale)
Get the translated name for the custom field or null if no translation exists.
|
String |
getCustomFieldNameTranslation(CustomField customField)
Get the translated name for the custom field or null if no translation exists.
|
String |
getCustomFieldNameTranslation(CustomField customField,
Locale locale)
Get the translated name for the custom field or null if no translation exists.
|
Map |
getInstalledLocales()
Retrieves the installed locales in the user's language.
|
String |
getIssueConstantTranslation(IssueConstant issueConstant,
boolean name,
Locale locale) |
String |
getIssueConstantTranslation(IssueConstant issueConstant,
boolean name,
String locale) |
String |
getIssueConstantTranslation(IssueConstant issueConstant,
boolean name,
String locale,
I18nHelper i18n)
Extract the desired string (name/description) from the specified issue constant.
|
String |
getTranslatedDescriptionFromString(String translationString) |
String |
getTranslatedNameFromString(String translationString) |
boolean |
hasLocaleTranslation(IssueConstant issueConstant,
String locale) |
void |
setCustomFieldTranslation(CustomField customField,
Locale locale,
String translatedName,
String translatedDesc)
Store the translated name and description for a custom field in a particular locale
|
void |
setIssueConstantTranslation(IssueConstant issueConstant,
String issueConstantPrefix,
Locale locale,
String translatedName,
String translatedDesc) |
public static final String JIRA_ISSUETYPE_TRANSLATION_PREFIX
public static final String JIRA_PRIORITY_TRANSLATION_PREFIX
public static final String JIRA_RESOLUTION_TRANSLATION_PREFIX
public static final String JIRA_STATUS_TRANSLATION_PREFIX
public static final String JIRA_CF_TRANSLATION_PREFIX
public static final String NONE
public TranslationManagerImpl(JiraAuthenticationContext authenticationContext, ApplicationProperties applicationProperties, I18nHelper.BeanFactory beanFactory)
public Map getInstalledLocales()
getInstalledLocales
in interface TranslationManager
public String getTranslatedNameFromString(String translationString)
getTranslatedNameFromString
in interface TranslationManager
public String getTranslatedDescriptionFromString(String translationString)
getTranslatedDescriptionFromString
in interface TranslationManager
public String getIssueConstantTranslation(IssueConstant issueConstant, boolean name, String locale, I18nHelper i18n)
If a system defined translation does not exist, the property file associated with the i18nHelper is checked.
getIssueConstantTranslation
in interface TranslationManager
issueConstant
- name
- boolean - fetch name or descriptionlocale
- used to check if system defined property existsi18n
- the i18nHelper to use to retrieve the translation from property files if no defined within systempublic String getIssueConstantTranslation(IssueConstant issueConstant, boolean name, String locale)
getIssueConstantTranslation
in interface TranslationManager
public boolean hasLocaleTranslation(IssueConstant issueConstant, String locale)
hasLocaleTranslation
in interface TranslationManager
public String getIssueConstantTranslation(IssueConstant issueConstant, boolean name, Locale locale)
getIssueConstantTranslation
in interface TranslationManager
public void setIssueConstantTranslation(IssueConstant issueConstant, String issueConstantPrefix, Locale locale, String translatedName, String translatedDesc)
setIssueConstantTranslation
in interface TranslationManager
public void deleteIssueConstantTranslation(IssueConstant issueConstant, String issueConstantPrefix, Locale locale)
deleteIssueConstantTranslation
in interface TranslationManager
public String getCustomFieldNameTranslation(CustomField customField)
TranslationManager
getCustomFieldNameTranslation
in interface TranslationManager
customField
- a custom fieldpublic String getCustomFieldNameTranslation(CustomField customField, Locale locale)
TranslationManager
getCustomFieldNameTranslation
in interface TranslationManager
customField
- a custom fieldlocale
- The locale to get the translation for.public String getCustomFieldDescriptionTranslation(CustomField customField)
TranslationManager
getCustomFieldDescriptionTranslation
in interface TranslationManager
customField
- a custom fieldpublic String getCustomFieldDescriptionTranslation(CustomField customField, Locale locale)
TranslationManager
getCustomFieldDescriptionTranslation
in interface TranslationManager
customField
- a custom fieldlocale
- The locale to get the translation for.public void setCustomFieldTranslation(CustomField customField, Locale locale, String translatedName, String translatedDesc)
TranslationManager
setCustomFieldTranslation
in interface TranslationManager
customField
- a custom fieldlocale
- the localetranslatedName
- the translated nametranslatedDesc
- the translated descriptionpublic void deleteCustomFieldTranslation(CustomField customField, Locale locale)
deleteCustomFieldTranslation
in interface TranslationManager
Copyright © 2002-2017 Atlassian. All Rights Reserved.