+ string bc = use_polyglossia ?
+ getPolyglossiaBegin(lang_begin_command, current_lang,
+ current_language->polyglossiaOpts())
+ : subst(lang_begin_command, "$$lang", current_lang);
+ os << bc;
+ pending_newline = !localswitch;
+ unskip_newline = !localswitch;
+ }
+ } else if (!par_lang.empty()) {
+ // If we are in an environment, we have to close the "outer" language afterwards
+ if (!style.isEnvironment() || state->open_polyglossia_lang_ != par_lang) {