[Tex/LaTex] Beamer: \appendix to add extra slides produces warning: Token not allowed in a PDF string

appendicesbeamerhyperrefwarnings

I am re-running an old Beamer presentation with TexLive 2017, and the command \appendix produces a warning that it did not use to produce, though it does work properly:

Token not allowed in a PDF string (Unicode):(hyperref) removing
`\translate '

See the following MWE. How can I get rid of that warning? Thanks!

\documentclass{beamer}

\usepackage{appendixnumberbeamer}

\mode<presentation> {
    \usetheme{AnnArbor}
    \usecolortheme{wolverine}
}

\begin{document}

\begin{frame}
    slide 1
\end{frame}

\begin{frame}
slide 2
\end{frame}

\begin{frame}
slide 3
\end{frame}

\appendix %do not count the following slides for the total number

\begin{frame}
extra slide 1
\end{frame}

\begin{frame}
extra slide 2
\end{frame}

\end{document}

Best Answer

Workaround:

\renewcommand{\appendixname}{\texorpdfstring{\translate{Appendix}}{Appendix}}

In fact, if your beamer version is resonable up-to-date, you don't need the appendixnumberbeamer to modify the frame numbering but you can use \setbeamertemplate{page number in head/foot}[appendixframenumber]

\documentclass{beamer}

%\usepackage{appendixnumberbeamer}

\mode<presentation> {
    \usetheme{AnnArbor}
    \usecolortheme{wolverine}
    \setbeamertemplate{page number in head/foot}[appendixframenumber]
}

\renewcommand{\appendixname}{\texorpdfstring{\translate{Appendix}}{Appendix}}

\begin{document}

\begin{frame}
    slide 1
\end{frame}

\begin{frame}
slide 2
\end{frame}

\begin{frame}
slide 3
\end{frame}

\appendix %do not count the following slides for the total number

\begin{frame}
extra slide 1
\end{frame}

\begin{frame}
extra slide 2
\end{frame}

\end{document}