This commit is contained in:
Marc Beninca 2020-10-08 20:01:06 +02:00
parent a864b4e8ae
commit 98676f03af
2 changed files with 9 additions and 5 deletions

View file

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

View file

@ -9,12 +9,10 @@
% language commands
\newcommand{\ifstr}[4]{\expandafter\ifstrequal\expandafter{#1}{#2}{#3}{#4}}
\newcommand{\bi}[2]{%
\ifstr{\mainlanguage}{en}{#1}{%
\ifstrempty{#2}{TRANSLATE ME!}{#2}%
}%
\expandafter\ifstrequal\expandafter{\mainlanguage}{en}%
{\ifstrempty{#1}{\ifstrempty{#2}{}{TRANSLATE\_ME!}}{#1}}%
{\ifstrempty{#2}{\ifstrempty{#1}{}{TRADUISEZ\_MOI\_!}}{#2}}%
}
\newcommand{\en}[1]{\textenglish{#1}}