Only use MessageFormatter if parameters are given.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 29 Jun 2011 07:18:07 +0000 (09:18 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 29 Jun 2011 07:18:07 +0000 (09:18 +0200)
src/main/java/net/pterodactylus/sone/freenet/L10nFilter.java

index 3c82565..910e0d6 100644 (file)
@@ -53,6 +53,9 @@ public class L10nFilter implements Filter {
         */
        @Override
        public String format(TemplateContext templateContext, Object data, Map<String, String> parameters) {
+               if (parameters.isEmpty()) {
+                       return l10n.getString(String.valueOf(data));
+               }
                List<Object> parameterValues = new ArrayList<Object>();
                int parameterIndex = 0;
                while (parameters.containsKey(String.valueOf(parameterIndex))) {