+
+ /**
+ * 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 + "}";
+ }
+ return new Scope(new SprintfCommand(msg, Arrays.asList(store)), scope);
+ }