My bibliography contains both English and Hebrew entries. To accomplish this I am using XeTeX, biblatex (with biber and biblatex-apa), and polyglossia.
Since biblatex does not come with Hebrew support, I would like to define the Hebrew bibliography strings (such as "editor") using the \DefineBibliographyStrings
command.
The problem: No matter what I try, my Hebrew bibliography items do not seem to register as Hebrew for the purpose of DefineBibliographyStrings
:
- If I use
\DefineBibliographyStrings{english}{editor={עורך}}
, then it changes the string in all entries (English and Hebrew). - If I use
\DefineBibliographyStrings{hebrew}{editor={עורך}}
, then it changes the string in none of the entries.
I have tried many ideas to solve this problem:
- Giving my bib entries
langid
,hyphenation
andlanguage
fields. - Tinkering with all possible
autolang
,language
andclearlang
options forbiblatex
. - Redefining the Hebrew entries as a random supported language such as German.
- Creating hebrew.lbx files, etc. to "add" Hebrew support to biblatex (copied from the english files with a tiny change here and there).
And nothing worked...
Here is a MWE:
bib file
@incollection{EnglishExample,
title={Example},
author={John McAuthor},
year={2016},
booktitle={American Journal of Examples},
editor={Jack McEditor},
pages={1-100}
}
@incollection{HebrewExample,
author={ר גורבטוב and א בן-משה and מ בן-שמחון},
title={אנשים עם פיגור שכלי},
booktitle={סקירת השירותים החברתיים 2009},
year={2009},
editor={י צבע},
pages={367-399},
address={ירושלים},
publisher={משרד הרווחה והשירותים החברתיים},
keywords={hebrew},
language={hebrew},
hyphenation={hebrew},
langid={hebrew}
}
tex file
\documentclass[oneside,english]{book}
\usepackage{fontspec}
\setmainfont[Mapping=tex-text]{Linux Libertine}
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}
\makeatletter
\usepackage{polyglossia}
\setdefaultlanguage{english}
\setotherlanguage{hebrew}
\usepackage{csquotes}
\usepackage[style=apa,backend=biber]{biblatex}
\addbibresource{mwe-hebrew-bib-strings.bib}
\DeclareLanguageMapping{english}{english-apa}
\DeclareLanguageMapping{hebrew}{english-apa} % this is needed for \DefineBibliographyStrings{hebrew}
\DefineBibliographyStrings{hebrew}{%
editor={עורך}
}
% the above \DefineBibliographyStrings affects NEITHER entry
% but changing it to {english} affects BOTH entries
\makeatother
\usepackage{xunicode}
\usepackage{polyglossia}
\setdefaultlanguage{english}
\begin{document}
\nocite{*}
\printbibliography
\end{document}
Note: The repeated loading of polyglossia and setdefaultlanguage happens against my will because I am using LyX, but I don't think it has an effect...
hyphenation
is a legacy alias oflangid
, you will only nedd one of the two fields, so you can drop thehyphenation={hebrew},