5

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:

  1. If I use \DefineBibliographyStrings{english}{editor={עורך}}, then it changes the string in all entries (English and Hebrew).
  2. 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 and language fields.
  • Tinkering with all possible autolang, language and clearlang options for biblatex.
  • 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...

  • 1
    Note that hyphenation is a legacy alias of langid, you will only nedd one of the two fields, so you can drop the hyphenation={hebrew}, – moewe Mar 6 '16 at 7:55
  • @moewe I actually knew that, and included both just to rule out the possibility that some of my packages are not up-to-date (although I checked, wanted to be sure). Thanks. – Yoni Rozenshein Mar 6 '16 at 8:24
4

There are several issues here. The biggest being that both biblatex and biblatex-apa lack Hebrew localisation.

But let's start with something less complicated. With

\DeclareLanguageMapping{hebrew}{english-apa}  % this is needed for \DefineBibliographyStrings{hebrew}

you effectively tell biblatex that Hebrew is the same as English (the APA "dialect" of English, to be precise). Since from that point on whenever your document has Hebrew text in it it will be treated as English, your \DefineBibliographyStrings{hebrew} has no effect as it only modifies the Hebrew strings that are not used at all.

So you will have to get rid of \DeclareLanguageMapping{hebrew}{english-apa}. But you will need some kind of hebrew-apa.lbx or at least some of the macros defined there. See Problem with apa style.

You will also have to teach biblatex Hebrew. Refer to What is the most appropriate way to configure biblatex for use with an unsupported language? for that. (You will probably also want to teach csquotes Hebrew: quotation mark (quotation sign) xelatex + polyglossia + csquotes.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.