# How to get polyglossia with babelshorthands to work with hyperref and csquotes?

I just switched from babel to polyglossia and got several errors which are related to the usage of \enquote in \section. The problems only occur if babelshorthands=true is set for polyglossia and hyperref is loaded. They don't occur when babel is used instead of polyglossia. Does anyone know how to solve this?

## Example

\documentclass{article}
\usepackage{polyglossia}
\setmainlanguage[babelshorthands=true]{german} % problems
%\setmainlanguage{german} % no problems
%\usepackage[german]{babel} % no problems
\usepackage{csquotes}
\usepackage{hyperref}

\begin{document}
\section{\enquote{Test}}
\end{document}


## Error Message

! Argument of \language@active@arg" has an extra }.
<inserted text>
\par
l.9 \section{\enquote{Test}}

-
+1, Great MWE! :) –  doncherry Sep 14 '13 at 11:55

You have activated the shorthands too early. This disturbs the loading of packages that do not expect catcode changes. Thus the version of \enquote that is used for the bookmarks is defined with an active " instead of being an inactive character.

Solution: Load the package csquotes earlier:

...
\usepackage{csquotes}
...
\setmainlanguage[babelshorthands=true]{german}


BTW, package babel has learned the lesson and activates the shorthands later via \AtBeginDocument.

-
I've got a very similar problem with polyglossia in combination with biblatex: Undefined control sequence. <argument> blx@lng@\bbl@main@language l.6 \begin{document} I got rid of it loading polyglossia before biblatex. –  musicman Oct 1 '14 at 12:39