
Costumo escrever textos em alemão e inglês e uso o JabRef para organizar minhas referências. Citando muitos artigos de conferências, muitas vezes é muito chato mudar sempre o idioma dos locais de acordo com o idioma do documento. Então me perguntei se poderia fornecer uma espécie de dicionário para o biblatex, para não ter que adaptar meu banco de dados toda vez.
Por exemplo, no preâmbulo eu gostaria de definir:
Munich = München
Germany = Deutschland
caso o documento ou linguagem babel seja ngerman
.
Isso pode ser feito?
MWE
\documentclass[ngerman]{article}
\usepackage[ngerman]{babel}
\begin{filecontents}{bla.bib}
@inproceedings{Orwell1984,
author = "George Orwell",
title = "1984",
year = "1948",
booktitle = "Books about big brothers",
location = "Munich, Germany",
}
\end{filecontents}
\RequirePackage[backend=biber,style=ieee-alphabetic]{biblatex}
\addbibresource{bla.bib}
\begin{document}
\cite{Orwell1984}. \\
\printbibliography
\end{document}
Responder1
Você pode usar biblatex
os jardineiras do para traduzir certas frases. A questão é qual seria uma boa interface. Se você quiser combinar termos arbitrários em um campo, terá que fazer algo como o seguinte (o que parece um pouco desajeitado).
\documentclass[ngerman]{article}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[backend=biber,style=ieee-alphabetic]{biblatex}
\NewBibliographyString{munich,germany}
\DefineBibliographyStrings{german}{
munich = {München},
germany = {Deutschland},
}
\begin{filecontents}{\jobname.bib}
@inproceedings{Orwell1984,
author = {George Orwell},
title = {1984},
year = {1948},
booktitle = {Books about big brothers},
location = {\bibstring{munich}, \bibstring{germany}},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\autocite{Orwell1984}
\printbibliography
\end{document}
Se você concordar em usar apenas uma string por campo, poderá tornar as coisas um pouco mais agradáveis
\documentclass[ngerman]{article}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[backend=biber,style=ieee-alphabetic]{biblatex}
\NewBibliographyString{de-munich}
\DefineBibliographyStrings{german}{
de-munich = {München},
}
\DefineBibliographyStrings{english}{
de-munich = {Munich, Germany},
}
\DeclareListFormat{location}{%
\usebibmacro{list:delim}{#1}%
\ifbibstring{#1}{\bibstring{#1}}{#1}\isdot
\usebibmacro{list:andothers}}
\begin{filecontents}{\jobname.bib}
@inproceedings{Orwell1984,
author = {George Orwell},
title = {1984},
year = {1948},
booktitle = {Books about big brothers},
location = {de-munich},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\autocite{Orwell1984}
\printbibliography
\end{document}
Uma solução mais BibTeX-y usa @string
s. Você pode definir strings para cada local em .bib
arquivos diferentes (um para cada idioma) e então selecionar o .bib
arquivo para o idioma necessário em seu documento.
\documentclass[ngerman]{article}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[backend=biber,style=ieee-alphabetic]{biblatex}
\begin{filecontents}{locationstrings-german.bib}
@string{de:munich = "München"}
\end{filecontents}
\begin{filecontents}{locationstrings-english.bib}
@string{de:munich = "Munich, Germany"}
\end{filecontents}
% select the bib file for the language you want
\addbibresource{locationstrings-german.bib}
\begin{filecontents}{\jobname.bib}
@inproceedings{Orwell1984,
author = {George Orwell},
title = {1984},
year = {1948},
booktitle = {Books about big brothers},
location = de:munich,
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\autocite{Orwell1984}
\printbibliography
\end{document}
A versão multiscript ainda muito experimental de biblatex
também pode ser interessante:https://github.com/plk/biblatex/issues/416
Responder2
\documentclass[ngerman]{article}
\usepackage[ngerman]{babel}
\begin{filecontents}{german-strings.bib}
@string{muenchen={München}}
@string{germany={Deutschland}}
\end{filecontents}
\begin{filecontents}[overwrite]{bla.bib}
@inproceedings{Orwell1984,
author = "George Orwell",
title = "1984",
year = "1948",
booktitle = "Books about big brothers",
location = muenchen # ", " # germany
}
\end{filecontents}
\RequirePackage[backend=biber,style=ieee-alphabetic]{biblatex}
\addbibresource{german-strings.bib}
\addbibresource{bla.bib}
\begin{document}
\cite{Orwell1984}. \\
\printbibliography
\end{document}