The following works as expected:
\newcommand{\engl}[2]{#1 (en. \textsl{#2})\index{en-ro}{#2}}
However, what I want to achieve would be a * version of it which only adds to the indices, without the visible text, something like:
\newcommand{\engl*}[2]{#1 (en. \textsl{#2})\index{en-ro}{#2}\term{#1!#2}\term{#2!#1}}
Of course, this does not work (the pdf is compiled, but with lots of warnings which were not there with the original definition), so I've tried something equivalent with xparse:
\usepackage{xparse}
\NewDocumentCommand\engl{sm}{%
\IfBooleanTF#1
{\index{en-ro}{#1}\term{#1}}
{#1 (en. \textsl{#2})\index{en-ro}{#2}\term{#1!#2}\term{#2!#1}}%
}
which doesn't work either.
How to properly create such a command and its * counterpart?