# Hyperref ignores \setdefaultlanguage from polyglossia

I use polyglossia to set my default language with \setdefaultlanguage to German. This works for the captions of tables, figures etc. I want to reference to these figures with the \autoref command of the hyperref package. But hyperref ignores the default language setting. But the reference name stays English (Table), although the caption title is showed German (Tabelle).

A minimal XeLaTeX example:

\documentclass{article}
\usepackage{xltxtra}
\usepackage{polyglossia}
\usepackage{hyperref}
\setdefaultlanguage{german}
\begin{document}
\begin{table}
\centering
\caption{Testtabelle}
\begin{tabular}{lr}
bla     & blub \\
blabla  & blubblub \\
\end{tabular}
\label{test}
\end{table}
Die Tabelle \autoref{test}.
\end{document}


I use a workaround \renewcommand{\tableautorefname}{Tabelle} to rename the reference. But of course, this is only a workaround and no real solution.

Has anybody any idea solving this issue?

A workaround is to pass the language as package option to hyperref:

\documentclass{article}
\usepackage{polyglossia}
\setdefaultlanguage{german}
\usepackage[german]{hyperref}
\begin{document}
\begin{table}
\centering
\caption{Testtabelle}
\begin{tabular}{lr}
bla     & blub \\
blabla  & blubblub \\
\end{tabular}
\label{test}
\end{table}
Die Tabelle \autoref{test}.
\end{document}

• Yes, this works, too. – kay102 Jun 21 '11 at 14:05
• This didn't work for me. I got:  The package hyperref has already been loaded with options: [] There has now been an attempt to load it with options [brazil] Adding the global options: ,brazil to your \documentclass declaration may fix this.  I did as the help suggested, but won't it use babel instead of polyglossia? – Mateus Felipe Feb 20 '19 at 21:13
• @MateusFelipe: The answer is now 8 1/2 years old. The package might have changed during this time. Feel free to post a new question with an example document which shows your problem and link back to this thread. – Martin Scharrer Feb 21 '19 at 6:38