- public String format(DataProvider dataProvider, Object data, Map<String, String> parameters) {
- return l10n.getString(String.valueOf(data));
+ public String format(TemplateContext templateContext, Object data, Map<String, Object> parameters) {
+ if (parameters.isEmpty()) {
+ return webInterface.getL10n().getString(String.valueOf(data));
+ }
+ List<Object> parameterValues = new ArrayList<Object>();
+ int parameterIndex = 0;
+ while (parameters.containsKey(String.valueOf(parameterIndex))) {
+ Object value = parameters.get(String.valueOf(parameterIndex));
+ parameterValues.add(value);
+ ++parameterIndex;
+ }
+ return new MessageFormat(webInterface.getL10n().getString(String.valueOf(data)), new Locale(webInterface.getL10n().getSelectedLanguage().shortCode)).format(parameterValues.toArray());