# Renew autoref caption titles when using polyglossia

I am trying to renew autoref caption titles when using the polyglossia package. Newer versions should, according to the manual, support the \addto command similar to Babel. However, I am unable to get it to work as the following MWE illustrates.

\documentclass{article}

\usepackage{hyperref}
\usepackage{etoolbox}
\usepackage{polyglossia}
\setmainlanguage[variant=american]{english}

%\usepackage[american]{babel}

\makeatletter
\renewcommand*{\sectionautorefname}{Section}    }
\makeatother

\begin{document}
\section{Test}\label{sec:test}
Autoref to \autoref{sec:test} for a test.
\end{document}


The command to append to in this case is \blockextras@english, not \extrasamerican:

\documentclass{article}

\usepackage{polyglossia}
\usepackage{hyperref}

\setdefaultlanguage[variant=american]{english}

\makeatletter
\appto{\blockextras@english}{%
\renewcommand*{\sectionautorefname}{Section}%
}
\makeatother

\begin{document}

\section{Test}\label{sec:test}
Autoref to \autoref{sec:test} for a test.

\end{document}


Besides, if you don't plan to use \autoref with other languages, you can place the \renewcommand outside the \appto altogether.

• I just see that you changed your answer from \appto{\captionsenglish}to \blockextras@english. What's the difference? – Jörg Mar 6 '12 at 14:43
• @Jörg: @egreg suggested that it is a more proper way semantically. Note that there is also a similar \inlineextras@english which will work inside \foreignlanguage or otherlanguage*. – Andrey Vihrov Mar 6 '12 at 14:46