Class TranslationManagerImpl
java.lang.Object
com.atlassian.jira.web.action.admin.translation.TranslationManagerImpl
- All Implemented Interfaces:
TranslationManager
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTranslationManagerImpl(JiraAuthenticationContext authenticationContext, ApplicationProperties applicationProperties, I18nHelper.BeanFactory beanFactory) -
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteCustomFieldTranslation(CustomField customField, Locale locale) voiddeleteIssueConstantTranslation(IssueConstant issueConstant, String issueConstantPrefix, Locale locale) getCustomFieldDescriptionTranslation(CustomField customField) Get the translated name for the custom field or null if no translation exists.getCustomFieldDescriptionTranslation(CustomField customField, Locale locale) Get the translated name for the custom field or null if no translation exists.getCustomFieldNameTranslation(CustomField customField) Get the translated name for the custom field or null if no translation exists.getCustomFieldNameTranslation(CustomField customField, Locale locale) Get the translated name for the custom field or null if no translation exists.Retrieves the installed locales in the user's language.getIssueConstantTranslation(IssueConstant issueConstant, boolean name, String locale) getIssueConstantTranslation(IssueConstant issueConstant, boolean name, String locale, I18nHelper i18n) Extract the desired string (name/description) from the specified issue constant.getIssueConstantTranslation(IssueConstant issueConstant, boolean name, Locale locale) getTranslatedDescriptionFromString(String translationString) getTranslatedNameFromString(String translationString) booleanhasLocaleTranslation(IssueConstant issueConstant, String locale) voidsetCustomFieldTranslation(CustomField customField, Locale locale, String translatedName, String translatedDesc) Store the translated name and description for a custom field in a particular localevoidsetIssueConstantTranslation(IssueConstant issueConstant, String issueConstantPrefix, Locale locale, String translatedName, String translatedDesc)
-
Field Details
-
JIRA_ISSUETYPE_TRANSLATION_PREFIX
- See Also:
-
JIRA_PRIORITY_TRANSLATION_PREFIX
- See Also:
-
JIRA_RESOLUTION_TRANSLATION_PREFIX
- See Also:
-
JIRA_STATUS_TRANSLATION_PREFIX
- See Also:
-
JIRA_CF_TRANSLATION_PREFIX
- See Also:
-
NONE
- See Also:
-
-
Constructor Details
-
TranslationManagerImpl
public TranslationManagerImpl(JiraAuthenticationContext authenticationContext, ApplicationProperties applicationProperties, I18nHelper.BeanFactory beanFactory)
-
-
Method Details
-
getInstalledLocales
Retrieves the installed locales in the user's language.- Specified by:
getInstalledLocalesin interfaceTranslationManager- Returns:
- A map containing the installed locales indexed by each locale's string representation.
-
getTranslatedNameFromString
- Specified by:
getTranslatedNameFromStringin interfaceTranslationManager
-
getTranslatedDescriptionFromString
- Specified by:
getTranslatedDescriptionFromStringin interfaceTranslationManager
-
getIssueConstantTranslation
public String getIssueConstantTranslation(IssueConstant issueConstant, boolean name, String locale, I18nHelper i18n) Extract the desired string (name/description) from the specified issue constant.If a system defined translation does not exist, the property file associated with the i18nHelper is checked.
- Specified by:
getIssueConstantTranslationin interfaceTranslationManager- Parameters:
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 system- Returns:
- String translated issue constant name or description
-
getIssueConstantTranslation
- Specified by:
getIssueConstantTranslationin interfaceTranslationManager
-
hasLocaleTranslation
- Specified by:
hasLocaleTranslationin interfaceTranslationManager
-
getIssueConstantTranslation
- Specified by:
getIssueConstantTranslationin interfaceTranslationManager
-
setIssueConstantTranslation
public void setIssueConstantTranslation(IssueConstant issueConstant, String issueConstantPrefix, Locale locale, String translatedName, String translatedDesc) - Specified by:
setIssueConstantTranslationin interfaceTranslationManager
-
deleteIssueConstantTranslation
public void deleteIssueConstantTranslation(IssueConstant issueConstant, String issueConstantPrefix, Locale locale) - Specified by:
deleteIssueConstantTranslationin interfaceTranslationManager
-
getCustomFieldNameTranslation
Description copied from interface:TranslationManagerGet the translated name for the custom field or null if no translation exists. This will use the current authentication context- Specified by:
getCustomFieldNameTranslationin interfaceTranslationManager- Parameters:
customField- a custom field- Returns:
- the translated name
-
getCustomFieldNameTranslation
Description copied from interface:TranslationManagerGet the translated name for the custom field or null if no translation exists.- Specified by:
getCustomFieldNameTranslationin interfaceTranslationManager- Parameters:
customField- a custom fieldlocale- The locale to get the translation for.- Returns:
- the translated name
-
getCustomFieldDescriptionTranslation
Description copied from interface:TranslationManagerGet the translated name for the custom field or null if no translation exists. This will use the current authentication context- Specified by:
getCustomFieldDescriptionTranslationin interfaceTranslationManager- Parameters:
customField- a custom field- Returns:
- the translated name
-
getCustomFieldDescriptionTranslation
Description copied from interface:TranslationManagerGet the translated name for the custom field or null if no translation exists.- Specified by:
getCustomFieldDescriptionTranslationin interfaceTranslationManager- Parameters:
customField- a custom fieldlocale- The locale to get the translation for.- Returns:
- the translated name
-
setCustomFieldTranslation
public void setCustomFieldTranslation(CustomField customField, Locale locale, String translatedName, String translatedDesc) Description copied from interface:TranslationManagerStore the translated name and description for a custom field in a particular locale- Specified by:
setCustomFieldTranslationin interfaceTranslationManager- Parameters:
customField- a custom fieldlocale- the localetranslatedName- the translated nametranslatedDesc- the translated description
-
deleteCustomFieldTranslation
- Specified by:
deleteCustomFieldTranslationin interfaceTranslationManager
-