# biblatex: change name of author according to language?

Usually a name stays the same in whatever language. So, whenever I quote a work by Knuth -- be it in an English article or a German one -- I will quote him as Donald E. Knuth.

This is not always the case with ancient or medieval names. They are spelled differently in different languages. Two examples in English | German | French:

• Aristotle | Aristoteles | Aristote
• Thomas Aquinas | Thomas von Aquin | Thomas d'Aquin

This means that when I write an English article, I need a bib-file that contains the English names, but when I want to write a German article, I need to go through my bib file and change the names accordingly. Depending on how often I in fact publish in English or German this could keep me busy and is prone to error.

So, I though, maybe I could have the different names already included in one single bib-file and let biblatex choose the correct name according to the primary language used in the document. Any ideas?

NB: I do not want to use in one single document both spellings Aristotle and Aristoteles (as the following MWE might make you think). Of course, if the article's primary language is English, then all the references to Aristotle will use the English spelling of his name. However, I want to be able to write articles in different languages, without (a) having to edit my bib-files each time or (b) generally maintaing not one single bib-file but two different ones, one for each language, or (c) having two distinct entries in one bib-file

## MWE

% !TEX TS-program = lualatexmk
\documentclass{scrartcl}

\usepackage{fontspec}
\setmainfont[Ligatures=TeX]{Times New Roman}

\usepackage[ngerman, british]{babel}
\usepackage[babel]{csquotes}
\usepackage[style=verbose,abbreviate=false,backend=biber]{biblatex}

\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@book{aristotle:ross:1924,
Author = {Aristotle},    % It is here, I think, that something could be done, e.g., ...
Title = {Metaphysics},     % ... british=Aristotle,ngerman=Aristoteles,french=Aristote
Editor = {William David Ross},
Commentator = {William David Ross},
Introduction = {William David Ross},
Hyphenation = {british},
Location = {Oxford},
Publisher = {Clarendon Press},
Volumes = {2},
Year = {1924}}
\end{filecontents}

\begin{document}

\selectlanguage{british}
Some English text.\footcite{aristotle:ross:1924}

\selectlanguage{ngerman}
Etwas Text auf Deutsch.\footcite{aristotle:ross:1924}

\end{document}

-

Here's a way:

\begin{filecontents}{\jobname.bib}
@book{aristotle:ross:1924,
Author = {\Aristotle},    % It is here, I think, that something could be done, e.g., ...
Title = {Metaphysics},     % ... british=Aristotle,ngerman=Aristoteles,french=Aristote
Editor = {William David Ross},
Commentator = {William David Ross},
Introduction = {William David Ross},
Hyphenation = {british},
Location = {Oxford},
Publisher = {Clarendon Press},
Volumes = {2},
Year = {1924}}
\end{filecontents}

\documentclass{scrartcl}

\usepackage{fontspec}
\setmainfont[Ligatures=TeX]{Times New Roman}

\usepackage[ngerman,french,british]{babel}
\usepackage[babel]{csquotes}
\usepackage[style=verbose,abbreviate=false,backend=biber]{biblatex}

\usepackage{xparse}
\ExplSyntaxOn
\NewDocumentCommand{\newauthor}{mm}
{
\clint_newauthor:nn {#1} {#2}
}
\tl_new:N \l__clint_author_tl
\cs_new_protected:Npn \clint_newauthor:nn #1 #2
{
\prop_new:c { g_clint_author_#1_prop }
\tl_set:Nn \l__clint_author_tl { #1 }
\keys_set:nn { clint-author } { #2 }
\cs_new:cpn { #1 } { \prop_get:cV { g_clint_author_#1_prop } \languagename }
}
\cs_generate_variant:Nn \prop_get:Nn { cV }
\keys_define:nn { clint-author }
{
unknown .code:n =
\prop_gput:cVn { g_clint_author_ \l__clint_author_tl _prop }
\l_keys_key_tl
{ #1 }
}
\ExplSyntaxOff

\newauthor{Aristotle}{
british=Aristotle,
ngerman=Aristoteles,
french=Aristote
}

\begin{document}

\selectlanguage{british}
Some English text.\footcite{aristotle:ross:1924}

\selectlanguage{ngerman}
Etwas Text auf Deutsch.\footcite{aristotle:ross:1924}

\selectlanguage{french}
Du texte en Français.\footcite{aristotle:ross:1924}

\end{document}


You define a control sequence with

\newauthor{Aristotle}{
british=Aristotle,
ngerman=Aristoteles,
french=Aristote
}


The command will be called \Aristotle (but the string is arbitrary). The command should be used in the .bib file. Maybe it's possible to use biblatex methods for processing the author name without changing it.

-
Note that as of September 2014, \prop_get:Nn has been renamed to \prop_item:Nn – egreg Sep 17 '14 at 17:59

This isn't really an "answer" per se. However. This is planned for biblatex 4.0/biber 4.0. You will (hopefully) be able to define alternatives like this:

AUTHOR = {Aristotle},
AUTHOR_translated_ngerman = {Aristoteles},
AUTHOR_translated_french = {Aristote}


and then pick these out within the style as:

\printname{author}
\printname[form=translated,lang=ngerman]{author}
\printname[form=translated,lang=french]{author}


probably switched using \selectlanguage as @egreg shows.

This sort of (optional, for backwards compatibility) form/lang interface is planned for any macros dealing with fields, list or names. Work is underway, the biber part is already done, the biblatex part is underway but is quite some work.

-
Are there any news about biblatex 3.0/biber 2.0? Or is there a release date already on the horizon? – ClintEastwood Oct 16 '14 at 17:13
It will be 4.0/4.0 and these are already available in the EXPERIMENTAL folders on SF. – PLK Oct 18 '14 at 22:08
how do I install these on Mac OS X? Is there a brief guide somewhere on the net? – ClintEastwood Dec 3 '14 at 14:28
It's just a manual install in your local texmf tree - I suspect that there are several examples of this on TSE. However, I wouldn't recommend it at the moment - I have to refactor some of the 4.0 things in the light of recent testing and the interfaces are likely to change. – PLK Dec 8 '14 at 10:28