我正在使用 biblatex(与 biber 一起使用)并language
在我的文件的条目中设置字段.bib
。奇怪的是,语言没有被解释为本地化键,而显然应该是这样。(我使用 polyglossia 进行语言支持和本地化。)
我得到如下输出。
Hume, D., 1777. An enquiry concerning human understanding. british.
(上面假定我设置了language = {british}
。如果我设置了language = {en-GB}
,那么相应的文本就会出现在输出文档中。)
我这里遗漏了什么吗?
顺便说一句,如果有人能推荐如何不是只要它是文档语言之一(即“默认”或“其他”语言之一),就打印参考书目中的语言。
最小可重复示例
\begin{filecontents*}[overwrite]{\jobname.bib}
@book{author00,
title = {{A Title}},
publisher = {Alpha},
year = {2008},
editor = {Author, A},
address = {London},
language = {english},
}
@book{buthor00,
title = {{B Title}},
publisher = {Bravo},
year = {1990},
author = {Buthor, B},
address = {New York},
language = {english},
}
\end{filecontents*}
\documentclass{article}
\usepackage{polyglossia}
\usepackage[backend = biber]{biblatex}
\addbibresource{\jobname.bib}
\begin{document}
\citeauthor{author00} has written \textcite{author00}.
\citeauthor{buthor00} has written \textcite{buthor00}.
\nocite{*}
\printbibliography
\end{document}
答案1
这是我在听取了@UlrikeFischer 在聊天中提出的一些善意建议后最终得到的解决方案。
主要问题是我做了\setdefaultlanguage{british}
但没有做\setmainlanguage{british}
,所以本地化没有生效。我真傻!
% Do not mention language of an entry if it is in the same or another variety of English.
% Copied from `tex/latex/biblatex/lbx/english.lbx` in the biblatex package, and adjusted accordingly.
% This solves the "side point" in my question.
\DeclareRedundantLanguages{british}{english,american,british,canadian,australian,newzealand,USenglish,UKenglish}
% Define localisation strings for the 'british' language.
% This is just an example, since due to the above "redundant languages" setting, this is superfluous, though it would not be if you did, e.g., `\DefineBibliographyStrings{spanish}{...}`.
\NewBibliographyString{langbritish}
\NewBibliographyString{frombritish}
\DefineBibliographyStrings{english}{
langbritish = {British},
frombritish = {from the British},
}