com.atlassian.jira.web.action.admin.translation
Class TranslationManagerImpl

java.lang.Object
  extended by com.atlassian.jira.web.action.admin.translation.TranslationManagerImpl
All Implemented Interfaces:
TranslationManager

public class TranslationManagerImpl
extends Object
implements TranslationManager


Field Summary
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 Summary
TranslationManagerImpl(JiraAuthenticationContext authenticationContext)
           
 
Method Summary
 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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JIRA_ISSUETYPE_TRANSLATION_PREFIX

public static final String JIRA_ISSUETYPE_TRANSLATION_PREFIX
See Also:
Constant Field Values

JIRA_PRIORITY_TRANSLATION_PREFIX

public static final String JIRA_PRIORITY_TRANSLATION_PREFIX
See Also:
Constant Field Values

JIRA_RESOLUTION_TRANSLATION_PREFIX

public static final String JIRA_RESOLUTION_TRANSLATION_PREFIX
See Also:
Constant Field Values

JIRA_STATUS_TRANSLATION_PREFIX

public static final String JIRA_STATUS_TRANSLATION_PREFIX
See Also:
Constant Field Values

JIRA_CF_TRANSLATION_PREFIX

public static final String JIRA_CF_TRANSLATION_PREFIX
See Also:
Constant Field Values

NONE

public static final String NONE
See Also:
Constant Field Values
Constructor Detail

TranslationManagerImpl

public TranslationManagerImpl(JiraAuthenticationContext authenticationContext)
Method Detail

getInstalledLocales

public Map getInstalledLocales()
Retrieves the installed locales in the user's language.

Specified by:
getInstalledLocales in interface TranslationManager
Returns:
A map containing the installed locales indexed by each locale's string representation.

getTranslatedNameFromString

public String getTranslatedNameFromString(String translationString)
Specified by:
getTranslatedNameFromString in interface TranslationManager

getTranslatedDescriptionFromString

public String getTranslatedDescriptionFromString(String translationString)
Specified by:
getTranslatedDescriptionFromString in interface TranslationManager

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:
getIssueConstantTranslation in interface TranslationManager
Parameters:
issueConstant -
name - boolean - fetch name or description
locale - used to check if system defined property exists
i18n - 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

public String getIssueConstantTranslation(IssueConstant issueConstant,
                                          boolean name,
                                          String locale)
Specified by:
getIssueConstantTranslation in interface TranslationManager

hasLocaleTranslation

public boolean hasLocaleTranslation(IssueConstant issueConstant,
                                    String locale)
Specified by:
hasLocaleTranslation in interface TranslationManager

getIssueConstantTranslation

public String getIssueConstantTranslation(IssueConstant issueConstant,
                                          boolean name,
                                          Locale locale)
Specified by:
getIssueConstantTranslation in interface TranslationManager

setIssueConstantTranslation

public void setIssueConstantTranslation(IssueConstant issueConstant,
                                        String issueConstantPrefix,
                                        Locale locale,
                                        String translatedName,
                                        String translatedDesc)
Specified by:
setIssueConstantTranslation in interface TranslationManager

deleteIssueConstantTranslation

public void deleteIssueConstantTranslation(IssueConstant issueConstant,
                                           String issueConstantPrefix,
                                           Locale locale)
Specified by:
deleteIssueConstantTranslation in interface TranslationManager

getCustomFieldNameTranslation

public String getCustomFieldNameTranslation(CustomField customField)
Description copied from interface: TranslationManager
Get the translated name for the custom field or null if no translation exists. This will use the current authentication context

Specified by:
getCustomFieldNameTranslation in interface TranslationManager
Parameters:
customField - a custom field
Returns:
the translated name

getCustomFieldNameTranslation

public String getCustomFieldNameTranslation(CustomField customField,
                                            Locale locale)
Description copied from interface: TranslationManager
Get the translated name for the custom field or null if no translation exists.

Specified by:
getCustomFieldNameTranslation in interface TranslationManager
Parameters:
customField - a custom field
locale - The locale to get the translation for.
Returns:
the translated name

getCustomFieldDescriptionTranslation

public String getCustomFieldDescriptionTranslation(CustomField customField)
Description copied from interface: TranslationManager
Get the translated name for the custom field or null if no translation exists. This will use the current authentication context

Specified by:
getCustomFieldDescriptionTranslation in interface TranslationManager
Parameters:
customField - a custom field
Returns:
the translated name

getCustomFieldDescriptionTranslation

public String getCustomFieldDescriptionTranslation(CustomField customField,
                                                   Locale locale)
Description copied from interface: TranslationManager
Get the translated name for the custom field or null if no translation exists.

Specified by:
getCustomFieldDescriptionTranslation in interface TranslationManager
Parameters:
customField - a custom field
locale - 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: TranslationManager
Store the translated name and description for a custom field in a particular locale

Specified by:
setCustomFieldTranslation in interface TranslationManager
Parameters:
customField - a custom field
locale - the locale
translatedName - the translated name
translatedDesc - the translated description

deleteCustomFieldTranslation

public void deleteCustomFieldTranslation(CustomField customField,
                                         Locale locale)
Specified by:
deleteCustomFieldTranslation in interface TranslationManager


Copyright © 2002-2014 Atlassian. All Rights Reserved.