I think this works:
\makeatletter
\AtEveryCitekey{%
\blx@langsetup\abx@field@hyphenation%
\blx@hyphenreset%
}
\makeatother
In \abx@field@hyphenation
is hyphenation value. Probably it needs some testing, if it is set.
edit:
Some time ago, I was looking at biblatex language switching because of problem with my citation style[1]. I didn't understand this code at all, so I ended with ugly hack[2].
But when I looked yesterday on biblatex's patch of babel you posted, I have found line
\blx@langsetup\languagename\select@language
Function \blx@langsetup
uses edef
to define \blx@languagename
, which is used by macro \blx@hyphenreset
to load hyphenation patterns, and then loads localization strings for given language. So in fact, instead of
\blx@langsetup\abx@field@hyphenation%
it is possible to use just
\edef\blx@languagename{\abx@field@hyphenation}%
Then there is problem with French language. When used as the main document language, instead of
... (Fis-
el 1985)...
there is
...(FISCHEL
1985)...
I think there is issue only with French, I tried Czech, Russian and Spanish and they worked correctly.
With babel
, we can solve this issue with
\select@language\abx@field@hyphenation%
but, polyglossia
in xelatex has same issue and this trick is there not working, I don't know how to fix that.
Anyway, if you don't need French with polyglossia
, this is the current solution
\makeatletter
\AtEveryCitekey{%
\ifcsdef{abx@field@hyphenation}{%
\edef\blx@languagename{\abx@field@hyphenation}%
\select@language\abx@field@hyphenation%
\blx@hyphenreset%
}{}%
}
\makeatother
[1] Biblatex - using two languages in one reference entry
[2] Biblatex - using two languages in one reference entry
For the original question, the modification required is:
\renewbibmacro*{title}{%
\ifthenelse{\iffieldundef{title}\AND\iffieldundef{subtitle}}
{}
{\printtext[title]{%
\printfield[apacase]{title}%
\setunit{\subtitlepunct}%
\printfield[apacase]{subtitle}}%
\setunit{\addspace}%
\printfield{titleaddon}%
\iffieldequalstr{entrytype}{book}%
{\setunit{\addspace}\usebibmacro{bookaddinfo}}%
{}%
\ifthenelse{%
\ifnameundef{author}\AND%
\(\ifnameundef{editor}\AND\NOT\boolean{bbx:editorinauthpos}\)\AND%
\ifnameundef{producer}\AND%
\ifnameundef{director}\AND%
\ifnameundef{writer}}
{\newunit\newblock
\usebibmacro{labelyear+extrayear}}
{}}}
\DeclareFieldFormat{origyear}{%
\mkbibparenss{\bibcpstring{origyear}~\thefield{origyear}%
\iffieldundef{origtitle}
{}%
{\addcolon\addspace\printfield{origtitle}}}%
}
\newbibmacro*{origyear}{%
\ifthenelse{
\NOT\iffieldundef{labelyear}
\AND\NOT\iffieldsequal{labelyear}{origyear}
\OR
\NOT\iffieldsequal{title}{origtitle}}
{\printfield{origyear}}
{}%
}
\DefineBibliographyStrings{german}{%
origyear = {Original erschienen}
}
This can be inserted in the preamble of your document.
For the extended version one has either to introduce new fields (this can be done,by modifying the data model, or by using the BibLaTeX facilities for related
).
EDIT 1 and EDIT 2
To accommodate the case where the author of the original publication is different the first step is to modify the data model, this can be done with:
\begin{filecontents}{biblatex-dm.cfg}
\DeclareDatamodelFields[type=list, datatype=name,skipout=false]{origauthor}
\DeclareDatamodelEntryfields{origauthor}
\end{filecontents}
This generates a file called biblatex-dm.cfg
in the current directory with the instruction about how to extend BibLaTeX data model.
Notice that BibLaTeX provides a titleaddon
field and this could be used to the extra information for the title ("Die Liebe" in the OP).
Eventually, one could add a field titletranslation
for the selfmade translation, i.e., one can include the following two lines in the datamodel file.
\DeclareDatamodelField[type=field, datatype=literal,skipout=false]{titletranslation}
\DeclareDatamodelEntryfields{titletranslation}
Another possibility is to use an "unused" field, for example, reprinttitle
. In what follow I'm going to use this option.
The next step is to modify the appropriate bibmacro
s. In this case, title
and origyear
for the formatting of the title (and related information about the original publication)
\renewbibmacro*{title}{%
\ifthenelse{\iffieldundef{title}\AND\iffieldundef{subtitle}}
{}
{\printtext[title]{%
\printfield[apacase]{title}%
\setunit{\subtitlepunct}%
\printfield[apacase]{subtitle}}%
\setunit{\addspace}%
\printfield{titleaddon}%
\setunit{\addspace}%
\printfield{reprinttitle}%
\iffieldequalstr{entrytype}{book}%
{\setunit{\addspace}\usebibmacro{bookaddinfo}}%
{}%
\ifthenelse{%
\ifnameundef{author}\AND%
\(\ifnameundef{editor}\AND\NOT\boolean{bbx:editorinauthpos}\)\AND%
\ifnameundef{producer}\AND%
\ifnameundef{director}\AND%
\ifnameundef{writer}}
{\newunit\newblock
\usebibmacro{labelyear+extrayear}}
{}}}
For originyear
the first thing to do is to define the format. To this we check that originauthor
is defined, and we set the punctuation accordingly:
\DeclareFieldFormat{origyear}{%
\mkbibparens{\bibcpstring{origyear}~\thefield{origyear}%
\ifnameundef{origauthor}
{}
{\addspace\bibstring{as}\addspace\printnames[FirstLast]{origauthor}}%
\iffieldundef{origtitle}
{}%
{\ifnameundef{origauthor}
{\setunit{\addcolon\addspace}}
{\setunit{\addcomma\addspace}}%
\printfield{origtitle}}}%
}
Then we have to consider the cases when we have to output the information about the original publication (here the condition is that either the year, or the title, or the author(s) is different).
\renewbibmacro*{origyear}{%
\ifthenelse{
\NOT\iffieldsequal{labelyear}{origdateyear}
\OR
\NOT\iffieldsequal{title}{origtitle}
\OR
\NOT\ifnamesequal{author}{origauthor}
}
{\printfield{origyear}}
{}%
}
Caveat A problem with the above solution is that not all bib entry types include instructions to format the information about the original publication using the above method. A more robust technique would be to use the facilities provided by BibLaTeX to handle related publications.
The last step is to use the appropriate value for the localisation strings origyear
and as
.
\NewBibliographyString{origyear,as}
\DefineBibliographyStrings{ngerman}{%
origyear = {Original erschienen},
as = {als}
}
\DefineBibliographyStrings{american}{%
as = {as}
}
Finally, to change the rendering of names, we have to modify the formatting instructions for apaauthor
\DeclareNameFormat{FirstLast}{%
\ifthenelse{\value{listcount}=\maxprtauth\AND\value{listcount}<\value{listtotal}}
{\addcomma\addspace\ldots}
{\ifthenelse{\value{listcount}>\maxprtauth\AND\value{listcount}<\value{listtotal}}
{}
{\iffirstinits
{\usebibmacro{name:first-last}{#1}{#4}{#5}{#7}}
{\usebibmacro{name:first-last}{#1}{#3}{#5}{#7}}}}
\ifmorenames{\andothersdelim\bibstring{andothers}}{}}
Best Answer
The bold "labels" tell you that bibstrings are not defined.
The reason that is happening is because the bibstrings for "retrieved from" and "origyear" are not defined in the "standard" language definition files (like ngerman.lbx), but by the APA style in ngerman-apa.lbx. You have mapped american to american-apa.lbx, but you haven't mapped ngerman to ngerman-apa.lbx -- so biblatex is looking for bibstrings in the default file and not finding them.
If you add the line
you get the strings you need. (I hesitated about this, because I thought I recalled some limitation on the number of such statements you could have; but I can't find that in the documentation, and it seems to work.)