private boolean valueOnIssueConstantIsTheDefault(IssueConstant issueConstant, boolean name) { I18nHelper defaultI18n = beanFactory.getInstance(Locale.ROOT); String key = getI18NTranslationKey(issueConstant, name); String defaultValue = defaultI18n.getResourceBundle().containsKey(key) ? defaultI18n.getResourceBundle().getString(key) : null; if (name) { return issueConstant.getName() != null && issueConstant.getName().equals(defaultValue); } return issueConstant.getDescription() != null && issueConstant.getDescription().equals(defaultValue); }
private String getTranslationFromI18nResources(IssueConstant issueConstant, I18nHelper i18n, boolean name) { if (i18n == null) { i18n = authenticationContext.getI18nHelper(); } String key = getI18NTranslationKey(issueConstant, name); String translation = i18n.getText(key); if (translation != null && !translation.contains(key)) { return translation; } return name ? issueConstant.getName() : issueConstant.getDescription(); }
public AbstractRemoteConstant(IssueConstant gv) { super(gv.getId(), gv.getName()); this.description = gv.getDescription(); this.icon = gv.getIconUrl(); if (TextUtils.stringSet(icon) && !this.icon.startsWith("http://")) { this.icon = ComponentAccessor.getApplicationProperties().getString(APKeys.JIRA_BASEURL) + icon; } }
public String doDefault() throws Exception { final T constant = getConstant(); if (constant == null) { addErrorMessage(getText("admin.errors.no.id.set")); return Action.ERROR; } else { name = constant.getName(); description = constant.getDescription(); iconurl = constant.getIconUrl(); } return super.doDefault(); }
return name ? issueConstant.getName() : issueConstant.getDescription();