\ProvidesFile{german-apa6.lbx}[2020/08/28\space v8.5\space APA 6th ed. biblatex localisation]
\InheritBibliographyExtras{german}

% (APA 6.22) The example abbreviations

% Following DGPs guidlines for German/Austrian
% http://homepage.univie.ac.at/harald.werneck/Richtlinien_zur_Manuskriptgestaltung.pdf

\NewBibliographyString{revisededition}
\NewBibliographyString{typechair}
\NewBibliographyString{typechairs}
\NewBibliographyString{typevolume}
\NewBibliographyString{typevolumes}
\NewBibliographyString{typeseries}
\NewBibliographyString{typeseriess}
\NewBibliographyString{typevolseries}
\NewBibliographyString{typevolseriess}
\NewBibliographyString{on}
\NewBibliographyString{retrieved}
\NewBibliographyString{available}
\NewBibliographyString{from}
\NewBibliographyString{archivedat}
\NewBibliographyString{origyear}
\NewBibliographyString{reviewof}
\NewBibliographyString{producer}
\NewBibliographyString{execproducer}
\NewBibliographyString{director}
\NewBibliographyString{writer}
\NewBibliographyString{with}

\DeclareBibliographyStrings{%
  inherit          = {german},
  andothers        = {{et\addabbrvspace al\adddot}{et\addabbrvspace al\adddot}},
  revisededition   = {{\"uberarbeitete\space Auf\noligature lage}{\"uberarb\adddotspace Aufl\adddot}},
  producer         = {{Produzent}{Produzent}},
  execproducer     = {{ausf\"uhrender Produzent}{ausf\adddotspace Produzent}},
  director         = {{Regisseur}{Regisseur}},
  writer           = {{Autor}{Autor}},
  page             = {{Seite}{{}S\adddot}},
  pages            = {{Seiten}{{}S\adddot}},
  on               = {{am}{am}},
  retrieved        = {{Zugriff}{Zugriff}},
  available        = {{Erh\"altlich}{Erh\"altlich}},
  with             = {{mit}{mit}},
  from             = {{unter}{unter}},
  archivedat       = {{archiviert\space unter}{archiviert\space unter}},
  reviewof         = {{Rezension\space des}{Rezension\space des}},
  paragraph        = {{\P}{\P}},
  paragraphs       = {{\P\P}{\P\P}},
  origyear         = {{Original\space erschienen}{Original\space erschienen}},
  typechair        = {{Leitung}{Leitung}},
  typechairs       = {{Leitung}{Leitung}},
  typevolume       = {{Bandherausgeber}{Bandhrsg\adddot}},
  typevolumes      = {{Bandherausgeber}{Bandhrsg\adddot}},
  typeseries       = {{Reihenherausgeber}{Reihenhrsg\adddot}},
  typeseriess      = {{Reihenherausgeber}{Reihenhrsg\adddot}},
  typevolseries    = {{Reihen- und\space Bandherausgeber}{Reihen-\space\& Bandhrsg\adddot}},
  typevolseriess   = {{Reihen- und\space Bandherausgeber}{Reihen-\space\& Bandhrsg\adddot}},
  annodomini       = {{A\adddot\addabthinspace D\adddot}{A\adddot\addabthinspace D\adddot}},
  beforechrist     = {{B\adddot\addabthinspace C\adddot}{B\adddot\addabthinspace C\adddot}},
}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% (APA 7.10 Example 68) Drop end* when they are the same as *

% You must use \printdate to get here otherwise it will be ignored
\DeclareBibliographyExtras{%
  \renewcommand{\apashortdash}{~}%
  \def\urldatecomma{\addspace}%
  \protected\def\mkbibdateapalong#1#2#3{%
    % As per 6.28, Articles only have year
    \ifboolexpr{ test {\ifentrytype{article}}
                 and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
      {\clearfield{labelmonth}%
       \clearfield{labelday}}
      {}%
    \iffieldundef{#1}%
      {}%
      {\iffieldbibstring{#1}{\bibstring{\thefield{#1}}}{\thefield{#1}}%
       \ifboolexpr{test {\iffieldundef{#3}} and test {\iffieldundef{#2}}}
         {}
         {\addcomma\space}}%
    \iffieldundef{#3}%
      {}%
      {\mkbibordinal{\thefield{#3}}%
       \iffieldundef{#2}
         {}
         {\addspace}}%
    \iffieldundef{#2}%
      {}%
      {\mkbibmonth{\thefield{#2}}}}%
  \protected\def\mkbibdateapalongextra#1#2#3{%
    % As per 6.28, Articles only have year
    \ifboolexpr{ test {\ifentrytype{article}}
                 and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
      {\clearfield{labelmonth}%
       \clearfield{labelday}}
      {}%
    \iffieldundef{#1}%
      {}%
      {\iffieldbibstring{#1}{\bibstring{\thefield{#1}}}{\thefield{#1}}%
       \printfield{extradate}%
       \ifboolexpr{test {\iffieldundef{#3}} and test {\iffieldundef{#2}}}
         {}
         {\addcomma\space}}%
    \iffieldundef{#3}%
      {}%
      {\mkbibordinal{\thefield{#3}}%
       \iffieldundef{#2}
         {}
         {\addspace}}%
    \iffieldundef{#2}%
      {}%
      {\mkbibmonth{\thefield{#2}}}}%
  \protected\def\mkbibdateapalongmdy#1#2#3{%
    % As per 6.28, Articles only have year
    \ifboolexpr{ test {\ifentrytype{article}}
                 and not test {\iffieldequalstr{entrysubtype}{nonacademic}} }
      {\clearfield{labelmonth}%
       \clearfield{labelday}}
      {}%
    \iffieldundef{#3}%
      {}%
      {\mkbibordinal{\thefield{#3}}}%
    \iffieldundef{#2}%
      {}%
      {\iffieldundef{#3}%
        {}%
        {\addspace}%
       \mkbibmonth{\thefield{#2}}}%
    \iffieldundef{#1}%
      {}%
      {\iffieldundef{#2}%
        {}%
        {\addspace}%
       \iffieldbibstring{#1}{\bibstring{\thefield{#1}}}{\thefield{#1}}}}%
  \def\apa@lbx@de@mkdaterangeapalong#1{%
    \begingroup
      \blx@metadateinfo{#1}%
      \iffieldundef{#1year}{}
        {\datecircaprint
         \ifstrequal{#1}{url}% URL dates are unlikely to be BCE ...
           {\printtext{%
               \iffieldsequal{#1year}{#1endyear}
                 {\iffieldsequal{#1month}{#1endmonth}
                    {\mkbibdateapalongmdy{}{}{#1day}}
                    {\mkbibdateapalongmdy{}{#1month}{#1day}}}
                 {\mkbibdateapalongmdy{#1year}{#1month}{#1day}}%
               \iffieldundef{#1endyear}%
                 {}%
                 {\iffieldequalstr{#1endyear}{}% open-ended range?
                   {\mbox{\bibdatedash}}
                   {\bibdatedash%
                    \mkbibdateapalongmdy{#1endyear}{#1endmonth}{#1endday}}}%
               \dateuncertainprint}}
           {\printtext{%
               \ifboolexpr{test {\iffieldsequal{#1year}{#1endyear}}
                           and test {\iffieldsequal{#1month}{#1endmonth}}}
                 {\mkbibdateapalong{#1year}{}{#1day}}%
                 {\mkbibdateapalong{#1year}{#1month}{#1day}}%
               \dateeraprint{#1year}%
               \iffieldundef{#1endyear}%
                 {}%
                 {\iffieldequalstr{#1endyear}{}% open-ended range?
                   {\mbox{\bibdatedash}}
                   {\bibdatedash%
                    \iffieldsequal{#1year}{#1endyear}%
                      {\mkbibdateapalong{}{#1endmonth}{#1endday}}%
                      {\mkbibdateapalong{#1endyear}{#1endmonth}{#1endday}%
                     \dateeraprint{#1endyear}}}%
                 \enddateuncertainprint}}}}%
    \endgroup}%
  \def\apa@lbx@de@mkdaterangeapalongextra#1{%
    \begingroup
      \blx@metadateinfo{#1}%
      \iffieldundef{#1year}{}
        {\printtext{%
          \datecircaprint
          \ifboolexpr{test {\iffieldsequal{#1year}{#1endyear}}
                           and test {\iffieldsequal{#1month}{#1endmonth}}}
            {\mkbibdateapalongextra{#1year}{}{#1day}}%
            {\mkbibdateapalongextra{#1year}{#1month}{#1day}}%
          \dateeraprint{#1year}%
          \dateuncertainprint
          \iffieldundef{#1endyear}%
            {}%
            {\iffieldequalstr{#1endyear}{}% open-ended range?
              {\mbox{\bibdatedash}}
              {\bibdatedash%
               \iffieldsequal{#1year}{#1endyear}%
                 {\mkbibdateapalongextra{}{#1endmonth}{#1endday}}
                 {\mkbibdateapalongextra{#1endyear}{#1endmonth}{#1endday}%
                  \dateeraprint{#1endyear}}}%
             \enddateuncertainprint}}}%
    \endgroup}%
  \savecommand\mkdaterangeapalong
  \savecommand\mkdaterangeapalongextra
  \def\mkdaterangeapalong{%
    \apa@lbx@de@mkdaterangeapalong}%
  \def\mkdaterangeapalongextra#1{%
    \apa@lbx@de@mkdaterangeapalongextra{#1}}%
}

\UndeclareBibliographyExtras{%
  \restorecommand\mkdaterangeapalong
  \restorecommand\mkdaterangeapalongextra
}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\endinput