From eae5254bfe0bb7bd00bf912c93c52f179ccf50d9 Mon Sep 17 00:00:00 2001 From: finga Date: Fri, 28 Feb 2025 12:20:32 +0100 Subject: [PATCH] Store and restore the previous language [WIP] --- dictionary.sty | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/dictionary.sty b/dictionary.sty index 0d612d7..72e678e 100644 --- a/dictionary.sty +++ b/dictionary.sty @@ -13,6 +13,11 @@ \PassOptionsToPackage{\@dictionary@primary,\@dictionary@secondary}{babel} +\newcommand{\previouslang}{\languagename} +%% \newcommand{\selectpreviouslang}{\selectlanguage{\languagename}} + +\newcommand{\debugDictionary}{primary: \@dictionary@primary, secondary: \@dictionary@secondary, previous: \previouslang} + \newcommand{\entry}[2]{% \DTLnewrow{dictionary}% \DTLnewdbentry{dictionary}{word}{#1}% @@ -22,9 +27,14 @@ \newenvironment{dictionary}{% \DTLifdbexists{dictionary}{\DTLcleardb{dictionary}}{\DTLnewdb{dictionary}}% }{% + \renewcommand{\previouslang}{\languagename} +%% \renewcommand{\selectpreviouslang}{\selectlanguage{\languagename}} \DTLsort{word}{dictionary}% \scriptsize% \DTLforeach*{dictionary}{\word=word,\translation=translation}{% \selectlanguage{\@dictionary@primary}\textbf{\word:} \selectlanguage{\@dictionary@secondary}\translation\\}% - \selectlanguage{\@dictionary@primary}% +%% \selectlanguage{vietnamese}\textbf{\word:} \selectlanguage{naustrian}\translation\\}% + \selectlanguage{\@dictionary@primary}% + %% \selectlanguage{\previouslang}% +%% \selectpreviouslang }