[Tex/LaTex] Polyglossia ignores the custom hyphenation

hyphenationpolyglossiaxetex

Polyglossia systematically ignores my custom \hyphenation, and generates overfull hboxes all over the place as a consequence.

Here’s an example:

\documentclass{article}

\usepackage{polyglossia}

\setmainlanguage[variant=uk]{english}

\hyphenation{a-bun-dance}

\begin{document}
A
abundance abundance abundance abundance abundance abundance abundance abundance
abundance abundance abundance abundance abundance abundance abundance abundance
\end{document}

Renders as (via xelatex example):

screenshot

This seems to happen for many/all words. The documentation doesn’t contain any hint at how to fix this. Is it a bug or am I doing something wrong?

This is using an up-to-date TeX Live 2014 with XeTeX 3.14159265-2.6-0.99991.

Best Answer

It appears the main language is set up at begin document, it is still US English in the preamble, it works if you delay the setting:

\documentclass{article}

\usepackage{polyglossia}

\setmainlanguage[variant=uk]{english}



\begin{document}
\hyphenation{a-bun-dance}

A
abundance abundance abundance abundance abundance abundance abundance abundance
abundance abundance abundance abundance abundance abundance abundance abundance
\end{document}