% Language definition file (part of polyglossia v2.10 -- 2026/04/18)
%
\ProvidesFile{gloss-afrikaans.ldf}[polyglossia: module for Afrikaans]

\PolyglossiaSetup{afrikaans}{
  bcp47=af,
  bcp47-language=af,
  bcp47-script=Latn,
  hyphennames={afrikaans,dutch},
  hyphenmins={2,2},
  langtag=AFK,
  frenchspacing=true,
 }

% BCP-47 compliant aliases
\setlanguagealias*{afrikaans}{af}

\DeclareKeys[polyglossia/gloss/afrikaans]
  {
    babelshorthands.if = afrikaans@babelshorthands,
    babelshorthands.default:n = true,
  }

\ifsystem@babelshorthands
  \SetGlossOptions{afrikaans}{babelshorthands=true}
  % Register default options
  \InitializeGlossOptions{afrikaans}{babelshorthands=true}
\else
  \SetGlossOptions{afrikaans}{babelshorthands=false}
  % Register default options
  \InitializeGlossOptions{afrikaans}{babelshorthands=false}
\fi

\InitializeBabelShorthands

\def\afrikaans@shorthands{%
  \xpg@activate@shorthands%
  \def\language@group{afrikaans}%
  \declare@shorthand{afrikaans}{"-}{\xpg@breakable@hyphen}%
  \declare@shorthand{afrikaans}{"~}{\xpg@nobreak@hyphen}%
  \declare@shorthand{afrikaans}{"|}{\xpg@ligature@break}%
  \declare@shorthand{afrikaans}{""}{\xpg@invisible@break}%
  \declare@shorthand{afrikaans}{"/}{\xpg@breakable@slash}%
  \def\-{\xpg@allowhyphenationbefore\discretionary{-}{}{}\xpg@allowhyphenationafter}%
}

\def\noafrikaans@shorthands{%
  \xpg@deactivate@shorthands%
}

\def\captionsafrikaans{%
    \def\prefacename{Voorwoord}%
    \def\refname{Verwysings}%
    \def\abstractname{Samevatting}%
    \def\bibname{Bibliografie}%
    \def\chaptername{Hoofstuk}%
    \def\appendixname{Bylae}%
    \def\contentsname{Inhoudsopgawe}%
    \def\listfigurename{Lys van figure}%
    \def\listtablename{Lys van tabelle}%
    \def\indexname{Inhoud}%
    \def\figurename{Figuur}%
    \def\tablename{Tabel}%
    \def\partname{Deel}%
    \def\enclname{Bylae(n)}%
    \def\ccname{a.\,a.}%
    \def\headtoname{Aan}%
    \def\pagename{Bladsy}%
    \def\seename{sien}%
    \def\alsoname{sien ook}%
    \def\proofname{Bewys}%
%   \def\glossaryname{}%
}

\def\dateafrikaans{%
    \def\today{\number\day~\ifcase\month\or
      Januarie\or Februarie\or Maart\or April\or Mei\or Junie\or
      Julie\or  Augustus\or September\or Oktober\or November\or
      Desember\fi
      \space \number\year}%
}

\def\noextras@afrikaans{%
  \ifafrikaans@babelshorthands\noafrikaans@shorthands\fi%
}

\def\blockextras@afrikaans{%
  \ifafrikaans@babelshorthands\afrikaans@shorthands\else\noafrikaans@shorthands\fi%
}

\def\inlineextras@afrikaans{%
  \ifafrikaans@babelshorthands\afrikaans@shorthands\else\noafrikaans@shorthands\fi%
}

\endinput
