+ pos = m.end();
+
+ }
+ out.print(escape(vars, parts.substring(pos)));
+ }
+
+ private String escape(Map<String, Object> vars, String target) {
+ if (vars.containsKey(OUT_KEY_PLAIN)) {
+ return target;
+ }
+ return HTMLEncoder.encodeHTML(target);
+ }
+
+ @Override
+ public void addTranslations(Collection<String> s) {
+ s.add(text);
+ }
+
+ /**
+ * Creates a simple {@link SprintfCommand} wrapped in a {@link Scope} to fit
+ * in now constant variables into this template.
+ *
+ * @param msg
+ * the message (to be translated) with <code>{0},{1},...</code>
+ * as placeholders.
+ * @param vars
+ * the variables to put into the placeholders.
+ * @return the constructed {@link Outputable}.
+ */
+ public static Outputable createSimple(String msg, Object... vars) {
+ HashMap<String, Object> scope = new HashMap<>();
+ String[] store = new String[vars.length];
+ for (int i = 0; i < vars.length; i++) {
+ scope.put("autoVar" + i, vars[i]);
+ store[i] = "${autoVar" + i + "}";