+string const getPolyglossiaBegin(string const & lang_begin_command,
+ string const & lang, string const & opts)
+{
+ string result;
+ if (!lang.empty())
+ result = subst(lang_begin_command, "$$lang", lang);
+ string options = opts.empty() ?
+ string() : "[" + opts + "]";
+ result = subst(result, "$$opts", options);
+
+ return result;
+}
+
+