From: David ‘Bombe’ Roden Date: Wed, 29 Jun 2011 07:18:07 +0000 (+0200) Subject: Only use MessageFormatter if parameters are given. X-Git-Tag: 0.6.6^2~44 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=080f32eaacd0b50837d9ed9e0328e725bcd71151;p=Sone.git Only use MessageFormatter if parameters are given. --- diff --git a/src/main/java/net/pterodactylus/sone/freenet/L10nFilter.java b/src/main/java/net/pterodactylus/sone/freenet/L10nFilter.java index 3c82565..910e0d6 100644 --- a/src/main/java/net/pterodactylus/sone/freenet/L10nFilter.java +++ b/src/main/java/net/pterodactylus/sone/freenet/L10nFilter.java @@ -53,6 +53,9 @@ public class L10nFilter implements Filter { */ @Override public String format(TemplateContext templateContext, Object data, Map parameters) { + if (parameters.isEmpty()) { + return l10n.getString(String.valueOf(data)); + } List parameterValues = new ArrayList(); int parameterIndex = 0; while (parameters.containsKey(String.valueOf(parameterIndex))) {