While biblatex
has a good reputation for supporting multi-language typesetting, there are a few things that are not implemented at the moment. In particular there is no per-field language switching, you can only switch the language of the entire entry, and even that may have some undesirable side-effects (see below).
Language markup in fields
One of the simplest idea to switch languages for specific fields is probably to add (polyglossia
or babel
) language switching commands to the respective fields directly. For example
title = {\foreignlanguage{german}{Prinzipien der Sprachgeschichte}},
This works for many fields and is a quick solution, but it comes with some caveats
- The language switching markup may mess up sorting. Biber strips some macros before sorting, but since it does not parse TeX (and does not know the definition of all macros), the example would be sorted under
g
and not under P
.
The switching markup can get messed up in or block field parsing. This becomes apparent in name fields.
author = {\begin{otherlanguage}{french}Dominic Quenneville\end{otherlanguage}},
Will fail completely, because Biber (and BibTeX) parse this as a name whose given component is \begin{otherlanguage}{french}Dominic
and whose family component is Quenneville\end{otherlanguage}
. biblatex
needs to be able to process these name parts independently of each other. But when the name parts are processed independently, the environments are unmatched leading to fatal errors.
So we would need to add a pair of additional braces to stop the name parsing (similar to Using a 'corporate author' in the "author" field of a bibliographic entry (spelling out the name in full))
author = {{\begin{otherlanguage}{french}Dominic Quenneville\end{otherlanguage}}},
Now the name is interpreted as consisting solely of the family part {\begin{otherlanguage}{french}Dominic\bibnamedelimb Quenneville\end{otherlanguage}}
. This means that again the sorting will be off and that the name formats will not work as one would expect. In particular the name will always show as "Dominic Quenneville" even if the name would normally be reversed ("Quenneville, Dominic") or only show the family name ("Quenneville"). Options like giveninits
will not work as expected, \mkbibnamefamily
and \mkbibnamegiven
will not have the desired effect.
So this method is only applicable for simple literal fields whose value should not matter for sorting. In general I would probably advise against it.
langid
& autolang
This langid
field should be the answer to your use case paul1920
. As explained in How does langid field in biblatex differ from language field? and elsewhere, this field can be used to switch the language of a complete entry.
With the default settings the field does not have any effect, however. You need to set the option autolang
to a value other than (the default) none
. You'd probably be interested in autolang=hyphen
. (Note that the option langid
should be set to autobib
(the default), autocite
or auto
if you want biblatex
to pick up the language from the langid
field. Setting language
to a language name will override all langid
field with that explicit values.) Then the entire entry is wrapped in \begin{hyphenrules}{<langid>}...\end{hyphenrules}
, which means that the entry is hyphenated according to the rules of <langid>
.
\documentclass{article}
\usepackage{polyglossia}
\setdefaultlanguage[variant = american]{english}
\setotherlanguage[variant = german]{german}
\usepackage[style = authoryear-comp, autolang=hyphen]{biblatex}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@book{paul1920,
author = {Hermann Paul},
title = {Prinzipien der Sprachgeschichte},
year = {1920},
edition = {5},
location = {Halle a.~S.},
publisher = {Max Niemeyer},
langid = {german},
}
\end{filecontents*}
\addbibresource{\jobname.bib}
\begin{document}
\nocite{*}
\parbox{0pt}{\hspace{0pt}\printbibliography}
\end{document}

If you set autolang=other
, the entry will be wrapped in \begin{otherlanguage}{<langid>}...\end{otherlanguage}
, which means that not only will hyphenation be according to <langid>
, the bibstrings will also be in <langid>
, so in the example above you will not see "5th. ed.", you'll see "5. Aufl.".

This highlights one issue with autolang=hyphen
. The entire entry will be hyphenated according to the rules of <langid>
, this does the right thing for field contents, which are in <langid>
, but the bibstrings are in the main document language (which may or may not be equal to <langid>
). In the example above "edition" would have been hyphenated according to German rules. This could be problematic.
Adding \begin{otherlanguage}{german}...\end{otherlanguage}
to the .bib
file outside of an entry will do nothing. Text outside of entries is ignored (silently by BibTeX and with a warning by Biber).
But I need something else
Unfortunately, this is all biblatex
offers at the moment.
You can't have per-field language switching with possibly different languages per entry (see https://github.com/plk/biblatex/issues/895).
It is sort of possible, but quite tricky, to switch only the field contents to <langid>
leaving the rest (bibstrings, punctuation) in the main document language (this works around the issues mentioned with autolang=hyphen
above). See Change language on a per field basis, part 2: Fonts, case transformation and sorting, note that the implementation has some drawbacks, it does for example not work with \MakeSentenceCase
.
Unfortunately, the implementation of a more sophisticated language switching mechanism looks quite complicated...
polyglossia
I should mention that biblatex
's polyglossia
support is not great. biblatex
can't detect polyglossia
's language variants and thus fails to produce the expected date format for british
or austrian
(or australian
). See for example \DeclareLanguageMappingSuffix, inheritance, and polyglossia in biblatex.
It should also be mentioned that the preferred way to switch languages according to the polyglossia
documentation seems to be \text<language>{...}
for a few words and \begin{<language>}...\end{<language>}
for longer passages in <language>
. \foreignlanguage{<language>}{...}
and \begin{otherlanguage}{<language>}...\end{otherlanguage}
are still supported, but only mentioned under Other commands.
otherlanguage
environment") precisely what I'm unsuccessful in accomplishing here?langid
entry in my reference? EDIT: No, addinglangid = "german"
did not work - it still won't hyphenate "Sprachgeschichte".