From 080f32eaacd0b50837d9ed9e0328e725bcd71151 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 29 Jun 2011 09:18:07 +0200 Subject: [PATCH] Only use MessageFormatter if parameters are given. --- src/main/java/net/pterodactylus/sone/freenet/L10nFilter.java | 3 +++ 1 file changed, 3 insertions(+) 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))) { -- 2.7.4