# Quotation marks based on langid with biblatex

I use biblatex with the csquotes and the babel package. Sometimes words in titles are set in qoutation marks. Normally I use \enquote for quotation marks. I want the style of the quotation marks in the bibliogaphy depent on the langid field. How can I achieve that?

Minimal example

\documentclass{scrartcl}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english, ngerman]{babel}
\usepackage[autostyle=true]{csquotes}
\usepackage[style=apa, autolang=hyphen]{biblatex}
\usepackage{filecontents}

\begin{filecontents*}{\jobname.bib}
@Book{Maximini2018,
author    = {Dominik Maximini},
title     = {Scrum -- Einführung in der Unternehmenspraxis: Von \enquote{starren} Strukturen zu agilen Kulturen},
year      = {2018},
publisher = {Springer},
langid    = {ngerman},
}

@Book{SchwaberSutherland2017,
author    = {Schwaber, Ken and Sutherland, Jeff},
title     = {The Scrum Guide\textsuperscript{TM}: The \enquote{Definitive} Guide to Scrum: The Rules of the Game},
year      = {2017},
langid    = {english},
url       = {https://www.scrumguides.org/docs/scrumguide/v2017/2017-Scrum-Guide-US.pdf},
}
\end{filecontents*}

\begin{document}
\nocite{*}
\printbibliography
\end{document}


What I get:

What I want:

• Why not just using Definite'' – koleygr Oct 11 '18 at 7:54
• But the rest of the entry should stay in German? I.e. the "Zugriff unter"? – moewe Oct 11 '18 at 7:57
• @moewe yes, as the document language is german – julianre Oct 11 '18 at 8:07
• corrected landid to langid – julianre Oct 11 '18 at 8:22

In situations like this it might indeed be safer to hard code the quotation marks. Anyway ... it is possible to get csquotes to change its quotation marks automatically.

csquotes responds to the current language as given in \languagename. And the hyphenation environment does not set the \languagename (any more, see BibLaTeX langid with autolang=hyphen makes csquotes use localized quotation marks). Hence, \enquote still uses the quotation marks of the document language in your example. The situation would be different with autolang=other since the environment used by that setting changes the \languagename. But it will also change the localisation of the bibstrings, so "Zugriff unter" would be translated into English, which might be undesirable.

If you want to tell csquotes to use langid's quotation marks within an entry that could be done with

\documentclass{scrartcl}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english, ngerman]{babel}
\usepackage[autostyle=true]{csquotes}
\usepackage[style=apa, autolang=hyphen]{biblatex}

\makeatletter
\def\blxcsq@resetstyle@langid{%
\ifnum\csq@reset=\@ne
\iffieldundef{langid}
{\let\blxcsq@tempa\languagename}
{\edef\blxcsq@tempa{\thefield{langid}}}%
\ifx\csq@currentstyle\blxcsq@tempa
\else
\ifcsundef{csq@qstyle@\blxcsq@tempa}
{\csq@warn@style\blxcsq@tempa
\csq@setstyle{fallback}}
{\csq@setstyle{\blxcsq@tempa}}%
\fi
\fi}
\AtEveryBibitem{\let\csq@resetstyle\blxcsq@resetstyle@langid}
\makeatletter

\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@Book{Maximini2018,
author    = {Dominik Maximini},
title     = {Scrum -- Einführung in der Unternehmenspraxis: Von \enquote{starren} Strukturen zu agilen Kulturen},
year      = {2018},
publisher = {Springer},
langid    = {ngerman},
}

@Book{SchwaberSutherland2017,
author    = {Schwaber, Ken and Sutherland, Jeff},
title     = {The Scrum Guide\textsuperscript{TM}: The \enquote{Definitive} Guide to Scrum: The Rules of the Game},
year      = {2017},
langid    = {english},
url       = {https://www.scrumguides.org/docs/scrumguide/v2017/2017-Scrum-Guide-US.pdf},
}
\end{filecontents*}