private ErrorCollection validateForSuggestion(final ApplicationUser user, final String token) { final ErrorCollection errors = new SimpleErrorCollection(); //check if the token contains any invalid characters. If it does return this to the client if(StringUtils.isNotEmpty(token) && !LabelParser.isValidLabelName(token)) { errors.addErrorMessage(beanFactory.getInstance(user).getText("label.service.error.label.invalid", token)); } return errors; }
@Override public String getBtfDescriptionHtml() { return i18nFactory.getInstance(authenticationContext.getUser()).getText("admin.generalconfiguration.introduction.description", "<br/>"); }
@Override protected I18nHelper getDelegate() { return factory.getInstance(authenticationContext.getUser()); } }
protected I18nHelper getI18n() { // You must not cache I18nHelper return i18n.getInstance(Locale.ENGLISH); }
public ServiceOutcome<StatusCategory> getDefaultStatusCategory(ApplicationUser user) { final StatusCategory statusCategory = statusCategoryManager.getDefaultStatusCategory(); if (statusCategory != null) { return ServiceOutcomeImpl.ok(statusCategory); } else { return ServiceOutcomeImpl.error(i18n.getInstance(user).getText("constants.service.status.category.not.found.default")); } }
private <T> ServiceOutcome<T> getError(ApplicationUser user, Reason reason, String key) { final String text = i18Factory.getInstance(user).getText(key); return outcomeForReason(reason, text); }
protected I18nHelper getI18n() { // you must not cache I18nHelper return i18n.getInstance(Locale.ENGLISH); } }
private void handleImportErrors(DataImportService.ImportResult lastResult) { ImportResultHandler importResultHandler = ComponentAccessor.getComponent(ImportResultHandler.class); importResultHandler.handleErrorResult(lastResult, ComponentAccessor.getI18nHelperFactory().getInstance(ComponentAccessor.getApplicationProperties().getDefaultLocale()), new SimpleErrorCollection()); }
private HelpUrlsParser createHelpUrlParser(final LoaderKey key) { return parserBuilderFactory.newBuilder() .defaultUrl(DEFAULT_HELP_URL, i18n.getInstance(key.locale).getText("jira.help.paths.help.title")) .applicationHelpSpace(applicationHelpSpaceProvider.getHelpSpace(key.applicationKey) // if application does not define help space uri fallback to core .orElse(applicationHelpSpaceProvider.getHelpSpace(ApplicationKeys.CORE))) .build(); }
private I18nHelper getI18n(ApplicationUser user) { return ComponentAccessor.getComponent(I18nHelper.BeanFactory.class).getInstance(user); } }
private void validateLinkingEnabled(final ApplicationUser user, final ErrorCollection errors) { final I18nHelper i18n = beanFactory.getInstance(user); if (!issueLinkManager.isLinkingEnabled()) { errors.addErrorMessage(i18n.getText("admin.issuelinking.status", i18n.getText("admin.common.words.disabled")), Reason.FORBIDDEN); } }
private String createTooComplexError(Clause clause) throws IOException { if (clause instanceof TerminalClause) { return i18n.getInstance(authenticationContext.getLocale()).getText("search.request.clause.too.complex", jqlStringSupport.generateJqlString(clause)); } else { return i18n.getInstance(authenticationContext.getLocale()).getText("search.request.clause.query.complex"); } }
I18nHelper getI18n(ApplicationUser user) { return factory.getInstance(user); } ///CLOVER:ON
@Override public RestFieldOperationsHandler getRestFieldOperation() { // this guy needs the IssueService and the IssueService needs the IssueLinksSystemField. so let's break up // the circular dependency... IssueFinder issueFinder = ComponentAccessor.getComponent(IssueFinder.class); return new IssueLinksRestFieldOperationsHandler(i18nFactory.getInstance(authenticationContext.getUser()), issueLinkTypeFinder, issueFinder); }
@Override public ServiceOutcome<Status> getStatusByTranslatedName(ApplicationUser user, String statusName) { Status status = constantsMgr.getStatusByTranslatedName(statusName); if (status != null && isStatusVisible(user, status)) { return ServiceOutcomeImpl.ok(status); } return ServiceOutcomeImpl.error(i18n.getInstance(user).getText("constants.service.status.not.found", statusName)); }
public void prepareCachedResourceBundleStrings(Locale locale) { clearCachedResourceBundleStrings(); I18nHelper i18nHelper = ComponentAccessor.getI18nHelperFactory().getInstance(locale); List<String> tmpResourceBundleStrings = new ArrayList<String>(i18nHelper.getKeysForPrefix("")); for (String key : tmpResourceBundleStrings) { cachedResourceBundleStrings.put(key, i18nHelper.getUnescapedText(key)); } }
private String getText(String key, String... params) { return i18nFactory.getInstance(jiraAuthenticationContext.getUser()).getText(key, params); } }
private I18nHelper i18n(ApplicationUser user) { return i18nFactory.getInstance(user); } }
/** * @return an I18nBean for the logged in user */ protected I18nHelper i18n() { return i18nFactory.getInstance(jiraAuthenticationContext.getUser()); }
/** * @return an error message */ @Override public String getHtml() { return i18Factory.getInstance(jiraAuthenticationContext.getUser()).getText("modulewebcomponent.exception", moduleDescriptor.getCompleteKey()); }