Store and restore the previous language [WIP]
This commit is contained in:
parent
01849f4046
commit
eae5254bfe
1 changed files with 11 additions and 1 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue