class OutputParams;
class Text;
-/** Register a language switch when using polyglossia.
- Set \p localswitch to true if the \text<lang> command is used.
+/** Register a language switch when using polyglossia or begin/end commands.
+ Set \p localswitch to true if a local command switch is used.
*/
-void pushPolyglossiaLang(std::string const & lang, bool localswitch = false);
+void pushLanguageName(std::string const & lang, bool localswitch = false);
-/** Unregister the last language switch when using polyglossia.
+/** Unregister the last language switch when using polyglossia
+ or begin/end commands.
*/
-void popPolyglossiaLang();
+void popLanguageName();
+
+/** Return a reference to the last active language opened with
+ polyglossia or when using begin/end commands. If none or when
+ using babel with only a begin command, return a reference to
+ an empty string.
+ */
+std::string const & openLanguageName();
/** Export optional and required arguments of the paragraph \p par.
Non-existing required arguments are output empty: {}.