@Override public String transformFromIrrelevant(final String fieldType, final Object input, final String url) { return i18nBean.getText("common.concepts.irrelevant"); }
@Override public String getText(String key, String... parameters) { return i18n.getText(key, parameters); }
protected static void verifyNotNull(ErrorCollection errors, I18nHelper i18n, String field, Object value) { if (value == null) { errors.addError(field, i18n.getText(MSG_IS_REQUIRED, field), VALIDATION_FAILED); } }
@Override public int compare(Field field1, Field field2) { if (field1 == null) throw new IllegalArgumentException("The first parameter is null"); if (field2 == null) throw new IllegalArgumentException("The second parameter is null"); String name1 = i18nHelper.getText(field1.getNameKey()); String name2 = i18nHelper.getText(field2.getNameKey()); return name1.compareTo(name2); } }
public String getLocalizedErrorMessage(I18nHelper helper) { notNull("helper", helper); return helper.getText(key, arguments); }
@Override public String transformFromReporter(final String fieldType, final Object input, final String url) { if (input == null) { return i18nBean.getText("gadget.filterstats.reporter.unknown"); } else { return htmlEncode(((ApplicationUser) input).getDisplayName().trim()); } }
@Override public String transformFromPriority(final String fieldType, final Object input, final String url) { if (input == null) { return i18nBean.getText("gadget.filterstats.priority.nopriority"); } else { return htmlEncode(((IssueConstant) input).getNameTranslation().trim()); } }
@Override public String transformFromComponent(final String fieldType, final Object input, final String url) { if (input == null) { return i18nBean.getText("gadget.filterstats.component.nocomponent"); } else { return htmlEncode(((ProjectComponent) input).getName().trim()); } }
@Override public String transformFromVersion(final String fieldType, final Object input, final String url) { if (input == null) { return i18nBean.getText("gadget.filterstats.raisedin.unscheduled"); } else { return htmlEncode(((Version) input).getName().trim()); } }
/** * @deprecated There are countless simpler and faster ways to get an {@code I18nHelper} and ask it to translate * something for you. Asking {@code IssueOperations} to do it does not make any sense. Since v6.3. */ @Deprecated public static String getText(String key) { return ComponentAccessor.getJiraAuthenticationContext().getI18nHelper().getText(key); } }
@Override public String transformFromCreator(final String fieldType, final Object input, final String url) { if (input == null) { return i18nBean.getText("gadget.filterstats.creator.unknown"); } else { return htmlEncode(((ApplicationUser) input).getDisplayName().trim()); } }
@Override @HtmlSafe public String getText(String key, Object value1, Object value2, Object value3) { return getI18nHelper().getText(key, value1, value2, value3); }
@Override @HtmlSafe public String getText(String key, Object parameters) { return getI18nHelper().getText(key, parameters); } }
@Override @HtmlSafe public String getText(String key, String value1, String value2, String value3) { return getI18nHelper().getText(key, value1, value2, value3); }
@Override @HtmlSafe public String getText(String key, String value1, String value2, String value3, String value4) { return getI18nHelper().getText(key, value1, value2, value3, value4); }
@Override protected Option<String> doGenerateMessage(final I18nHelper localisedMessages) { return Option.some(localisedMessages.getText("attachfile.error.temp.writeerror", this.getMessage())); } }
private void validateAttachmentLimitSize(File file, String fileName) throws AttachmentException { long maxAttachmentSize = Long.parseLong(applicationProperties.getDefaultBackedString(APKeys.JIRA_ATTACHMENT_SIZE)); if (file.length() > maxAttachmentSize) { final String message = getI18nBean().getText("upload.too.big", fileName, FileSize.format(file.length()), FileSize.format(maxAttachmentSize)); throw new AttachmentExceedsLimitException(message); } }
@Override public DeletePropertyValidationResult get() { errorCollection.addErrorMessage(i18n.getText("jira.properties.service.property.does.not.exist", propertyKey), NOT_FOUND); return new DeletePropertyValidationResult(errorCollection, Option.<EntityProperty>none()); } }, new Function<EntityProperty, DeletePropertyValidationResult>()
private PercentageGraphModel createProgressGraph() { final PercentageGraphModel gm = new PercentageGraphModel(); gm.addRow(Colors.TIME_SPENT, timeSpent, getTimeSpentTooltip()); gm.addRow(Colors.REMAINING_TIME, remainingEstimate, getRemainingEstimateTooltip()); if (originalEstimate > totalTime) { gm.addRow(Colors.LEFT_OVER, originalEstimate - totalTime, i18nHelper.getText("common.concepts.time.not.required")); } return gm; }
public static void setDefaults(JFreeChart chart, final I18nHelper i18nHelper) { chart.setBackgroundPaint(Color.WHITE); chart.setBorderVisible(false); chart.getPlot().setNoDataMessage(i18nHelper.getText("gadget.charts.no.data")); setupPlot(chart.getPlot()); ChartUtil.setupTextTitle(chart.getTitle()); ChartUtil.setupLegendTitle(chart.getLegend()); }