The definition seems to be "almost" correct, in that it gives almost the expected result, apart from spurious spaces:
\newcommand{\mynewcommand}[3]{%
\newcommand{#1}{%
\iflanguage{english}{#2}{%
\iflanguage{french}{#3}{}
}%
}%
}
However this is error prone if one wanted to augment the supported languages; with xparse it's easier:
\usepackage{xparse}
\ExplSyntaxOn
\NewDocumentCommand{\mynewcommand}{m m m}
{
\cs_new:Npn #1
{
\prg_case_str:onn { \languagename }
{
{english}{#2}
{french}{#3}
}
{``No~def~of~\texttt{\token_to_str:N #1}~for~\languagename''}
}
}
\ExplSyntaxOff
If other languages were desired it would be sufficient to add an argument to \mynewcommand and the suitable line along the same scheme.
An alternative way might be to define different commands:
\makeatletter
\newcommand{\newlanguagecommand}[1]{%
\newcommand#1{%
\@ifundefined{\string#1\languagename}
{``No def of \texttt{\string#1} for \languagename''}
{\@nameuse{\string#1\languagename}}%
}%
}
\newcommand{\addtolanguagecommand}[3]{%
\@namedef{\string#1#2}{#3}}
\makeatother
\newlanguagecommand{\uno}
\addtolanguagecommand{\uno}{english}{one}
\addtolanguagecommand{\uno}{french}{une}
Unknown languages will result in "No def of \command for language"
With \newlanguagecommand{\uno} one defines the command so that its expansion is \\uno<languagename>; for example, when the language is French, writing \uno will use \\unofrench which is defined by \addtolanguagecommand{\uno}{french}{une} to expand to "une".
This should give no problems also in moving arguments as long as the replacement text doesn't contain fragile commands (text is OK).
Error: Missing \begin{document}– D.Roepo Jan 30 '12 at 13:32\listfiles. – Marco Daniel Jan 30 '12 at 13:40