Beamer: Package iflang Warning: Mismatch between \language (patterns) (iflang) and setting of \languagename

When loading the iflang package in a beamer presentation I get the warning Package iflang Warning: Mismatch between \language (patterns) (iflang) and setting of \languagename.

\documentclass{beamer}
\usepackage[english]{babel}
\usepackage{iflang}

\begin{document}
content...
\end{document}


This warning occurs regardless of whether I load the babel package or pass the language as class option as well.

If I change the document class from beamer to article I do not get this warning regardless of whether I load the babel package or pass the language as class option.

A question regarding this warning has been asked before, there however in the context of the article class (where I do not get this warning) and not in the context of pdflatex (because the polyglossia package was used). I have tried the three ways in the answer but I was unable to avoid the warning with any of them.

The beamer documentation section 2.6 Compatibility with Other Packages and Classes does not mention the iflang package.

I am using beamer 2013/12/02 3.33 and pdfTeX, Version 3.14159265-2.6-1.40.15 (TeX Live 2015/dev/Debian) (preloaded format=pdflatex 2017.4.22).

Does this warning do any harm? How can I avoid it using the beamer class?

• Just as information: I also get this warning with an up to date texlive2017. – user36296 Jan 20 '18 at 13:34

It's a bug in iflang, which relies on \uselanguage being defined for distinguishing between a format based on language.dat (essentially LaTeX in various engine dependent flavors) or on etex.src (essentially plain TeX based formats).

If \uselanguage is defined, iflang assumes the latter kind of format. However, beamer does define \uselanguage, so the final test performed by the package fails and, most likely, also other tests.

I made a test and changed line 196 of iflang.sty (v. 1.6, released 2016/05/16) from

\expandafter\ifx\csname uselanguage\endcsname\relax


into

\expandafter\ifx\csname et@xpatterns\endcsname\relax


and the tests work as expected. The macro \et@xpatterns is most likely only defined in etex.src.

As a (hopefully temporary) workaround, you can fix manually the wrong setup:

\documentclass{beamer}
\usepackage[english]{babel}
\usepackage{iflang}

\makeatletter
\def\IfLang@prefix{l@}
\makeatother

\begin{document}
content...
\end{document}


but you have to live with the spurious warning.