other languages

This commit is contained in:
Marc Beninca 2020-10-08 21:07:48 +02:00
parent 59574d623b
commit 1538172cae
3 changed files with 19 additions and 8 deletions

View file

@ -4,13 +4,13 @@
% begin document
\begin{document}
\bi{}{}
\ml{}{}
\bi{Hello world!}{}
\ml{Hello world!}{}
\bi{}{Bonjour monde !}
\ml{}{Bonjour monde !}
\bi{Hello world!}{Bonjour monde !}
\ml{Hello world!}{Bonjour monde !}
% end document
\end{document}

View file

@ -6,12 +6,12 @@
% set languages
\setmainlanguage{\mainlanguage}
\setotherlanguages{en,fr}
\setotherlanguages{\otherlanguages}
% language commands
\newcommand{\ifstr}[4]{\expandafter\ifstrequal\expandafter{#1}{#2}{#3}{#4}}
\newcommand{\bi}[2]{%
\newcommand{\ml}[2]{%
\ifstr{\mainlanguage}{en}{\ifstrempty{#1}{TRANSLATE\_ME!}{#1}}{%
\ifstr{\mainlanguage}{fr}{\ifstrempty{#2}{TRADUISEZ\_MOI\_!}{#2}}{%
SHOULD\_NOT\_HAPPEN!%