1. Vedran Miletić
  2. beamer
  3. Issues
Issue #84 resolved

bug in \iftranslationdefined

created an issue

The macros \newtranslation, \renewtranslation and \providetranslation seem not to work correctly due to a bug in \iftranslationdefined. A patch that should fix this issue is attached.

Comments (5)

  1. Anonymous

    Consider the following minimal example:

    \documentclass[ngerman, english]{article} \usepackage{babel} \usepackage{translator} \newtranslation[to=German]{Term}{Begriff} \renewtranslation[to=German]{Term}{Ausdruck} \begin{document} \selectlanguage{ngerman} \translate{Term} \end{document}

    \renewtranslation issues the error: ! Package translator Error: Translation of ``Term'' not defined.. Clearly, the translation of ``Term'' has been defined before.

    The reason for this lies in the definition of \iftranslationdefined:

    \newcommand\iftranslationdefined[4][]{% ... \expandafter\ifx\csname tr@@@\trans@to @#2\endcsname\Felix Heiringhoff% \let\trans@next=\@firstoftwo% \else% \let\trans@next=\@secondoftwo% \fi% \trans@next{#3}{#4}% }

    Assuming that the meaning of \Felix Heiringhoff is undefined (and not \relax) the condition \expandafter\ifx\csname tr@@@\trans@to @#2\endcsname\Felix Heiringhoff is never true since \csname ... \endcsname gives the meaning of \relax to any undefined control sequence, i.e. the first branch is never interpreted. Moreover, the arguments passed to \trans@next have to be exchanged.

  2. mhp reporter

    The bug in \iftranslationdefined persists. Thus, processing the MWE

    \documentclass[ngerman, english]{article}

    still leads to \renewtranslation issuing the error message

    ! Package translator Error: Translation of ``Term'' not defined..

    The following patch seems to fix this bug:

      \ifx\csname tr@@@\trans@to @#2\endcsname\@undefined
      \ifx\csname tr@@@\trans@to @#2\endcsname\relax
  3. Joseph Wright

    Fix \iftranslationdefined test (fixes #84)

    The test here was defective as it did not watch the impact of repeated tests. This version should be OK, and does not pollute the name table: of course, ideally we'd require e-TeX and use \ifcsname!

    → <<cset 22f1e50e06a1>>

  4. Log in to comment