Intro
I'm testing development versions of the biblatex package (3.5) with the biber (Date modified 2016-08-03 18:31) backend. These versions add various kinds of date support (e.g. approximate dates, BCE/BC dates, datetimes).
I'm trying to get biblatex to work with polyglossia (Version 1.42.1; packaged on 2016-03-29). Specifically for the dates in bibliographic entries to be affected by the polyglossia language variant setting. Chiefly - for the day, month, and year sequence; and month names - to be language dependent.
I'm using the xetex engine.
My minimal working example (MWE) is:
\documentclass{article}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{barker_2016_swiss,
author = {Barker, Anne},
title = {Swiss voters say no to guaranteed free money},
date = {2016-06-06},
journaltitle = {ABC News},
}
\end{filecontents}
\usepackage{fontspec}
%\usepackage[british]{babel}
\usepackage{polyglossia}
\setdefaultlanguage[variant=british]{english}
\usepackage[%
style=authoryear,%
alldates=long,%
language=auto,%
autolang=langname,%
backend=biber]{biblatex}
\addbibresource{\jobname.bib}
\begin{document}
Current language: \currentlang. \autocite{barker_2016_swiss}
\printbibliography
\end{document}
Result
I get:
Current language: english. (Barker 2016)
References
Barker, Anne (June 6, 2016). “Swiss voters say no to guaranteed free money”. In: ABC News.
That is, the output seems to format the date as american english (which is the default in biblatex for later versions).
Expected
I expected, however, "Current language: british" and the date to be formatted as "6th June 2016". And indeed I get that if I change my MWE to use babel ...
\usepackage[british]{babel}
%\usepackage{polyglossia}
%\setdefaultlanguage[variant=british]{english}
... that is, the result is (as I would expect) ...
Current language: british. (Barker 2016)
References
Barker, Anne (6th June 2016). “Swiss voters say no to guaranteed free money”. In: ABC News.
Testing polyglossia with main language
Also if I use polyglossia with a main language setting, rather than a variant, then I get expected results. I.e. If in my MWE I have
%\usepackage[british]{babel}
\usepackage{polyglossia}
\setdefaultlanguage{french}
... then I get ...
Current language : french. (Barker 2016)
Références
Barker, Anne (6 juin 2016). “Swiss voters say no to guaranteed free money”. In : ABC News.
Problem summary
In summary, with my MWE, babel and polyglossia work as expected with biblatex when using \usepackage[*mainlanguage*]{babel} and \setdefaultlanguage{*mainlanguage*} respectively. But polyglossia doesn't work when using \setdefaultlanguage[variant=*somevariantlanguage*]{english}.
Other considerations
I've ran this past the biblatex developer (of date support), @PLK, and they wrote
I think there are some issues with Polyglossia still - there has been a release pending for some time to fix some of these issues I think.
I've tried using the LuaTex engine, with no joy.
Setting \usepackage[ ... language=british ....]{biblatex} doesn't help.
At this point it feels like a bug in Polyglossia. But before raising an issue at the Polyglossia github I'd appreciate if anyone can identify anything wrong that I'm doing. Also if anyone can reproduce this issue with a production version of biblatex/biber that'd save me the rigmarole of downgrading.
Updates:
2016-08-16 07:39: From the comments this appears to be a Polylossia issue. And so I've posted Github > Polyglossia > Exposing Polyglossia language variants to other packages like Biblatex. #154. (Edit: 2016-08-16 08:00 corrected link)
2016-08-17 19:31 My workaround will be to use babel (with thanks to @UlrikeFischer for clearing the way to it).
polyglossiadoes not really work inbiblatex. (Thecsquotespackage, which was devised by the same author asbiblatex, has a footnote: "Note thatpolyglossiasupport is currently in a preliminary state becausepolyglossiais lacking a proper interface for other packages. In practice, this means thatcsquotescan detect the language (e.g.,english) but not the language variant (e.g.,british).") – moewe Aug 15 '16 at 13:35biblatex, likedatetime2andcsquotes). One can even createpolyglossiacompatible language wrappers like\begin{german} ... \end{german}(in the doc body), by using\babeltags{german=german}in the preamble. All that makes the current "workaround", of usingbabel, so far painless. – John Bentley Aug 17 '16 at 09:31