Article in Portuguese, how to get sentence case in bibliography

apa-stylebabelbiberbiblatexlanguages

I'm writing an article in Portuguese, but where most references have English titles. I'm following the APA citation style. In the bibliography, I'd like to have terms like 'translator', date formats and ordinals in Portuguese, but sentence case capitalization according to the APA rules.

Here's an example:

\documentclass{article}
\usepackage[english,main=portuguese]{babel}
\usepackage{csquotes}
\usepackage[backend=biber, style=apa, natbib=true]{biblatex}

\begin{filecontents}{foo.bib}
@article{en,
author={John},
title={This Should Be in Sentence Case},
journal={Title Case Journal},
language={english}
}

@article{pt,
author={João},
title={Título do Artigo},
journal={Título da Publicação},
language={portuguese}
}
\end{filecontents}

\addbibresource{foo.bib}

\begin{document}

\nocite{en}
\nocite{pt}

\printbibliography
\end{document}

Which produces:

enter image description here

If I remove the babel package the article titles are correctly converted to sentence case. But how can I keep the localization features for Portuguese, as well as correct capitalization, at least for English language titles?

Best Answer

The biblatex language field is meant set "the language(s) of the work", and may be consumed by the entry type driver as content. What you are looking for is the langid field, which tells biblatex the language in which the bib entry should be typeset.

\documentclass{article}
\usepackage[english,main=portuguese]{babel}
\usepackage{csquotes}
\usepackage[backend=biber, style=apa, natbib=true]{biblatex}

\begin{filecontents}{foo.bib}
@article{en,
author={John},
title={This Should Be in Sentence Case},
journal={Title Case Journal},
langid={english}
}

@article{pt,
author={João},
title={Título do Artigo},
journal={Título da Publicação},
langid={portuguese}
}
\end{filecontents}

\addbibresource{foo.bib}

\begin{document}

\nocite{en}
\nocite{pt}

\printbibliography
\end{document}

enter image description here

I think only this change is likely sufficient. But you may be interested in the autolang option, which allows you to control which type of language environment is used by your bibliography entries.

Related Question