%%
%% Locale for some float labels and articleinfo/bookinfo stuff
%%

\long\def\dolangsetup#1#2{%
  \expandafter\def\csname setup@lang@#1\endcsname{#2}%
}

\def\dosetuplang#1{%
  \csname setup@lang@#1\endcsname%
}

%% Internal interface
\long\def\langsetupdbk#1#2{ \dolangsetup{dbk@#1}{#2} }
\def\setuplocale#1{ \dosetuplang{dbk@#1} }

%% User Babel setup hooks
\long\def\babelsetup#1#2{ \dolangsetup{bab@#1}{#2} }
\def\setupbabel#1{ \dosetuplang{bab@#1} }

%% Define the locale setups in docbook
\langsetupdbk{de}{
  \def\refname{Referenzen}%
  \def\abstractname{Zusammenfassung}%
  \def\bibname{Bibliographie}%
  \def\prefacename{Vorwort}%
  \def\chaptername{Kapitel}%
  \def\appendixname{Anhang}%
  \def\contentsname{Inhaltsverzeichnis}%
  \def\listfigurename{Abbildungsverzeichnis}%
  \def\listtablename{Tabellenverzeichnis}%
  \def\indexname{Index}%
  \def\figurename{{\scshape Abbildung }}%
  \def\tablename{{\scshape Tabelle }}%
   
  \def\examplename{Beispiel}
  \def\ondate{am}
  \renewcommand{\DBKreleaseinfo}{Arbeitspapier}
  \def\writtenby{VERFASST DURCH}
  \def\projname{PROJEKT}
  \def\titlename{TITEL}
  \def\DBKindname{NAME}
  \def\DBKindtitle{MITWIRKENDE}
  \def\DBKrevtitle{VERSIONSGESCHICHTE}
  \def\DBKrevdesc{BESCHREIBUNG}
  \def\DBKrevnumber{NUMMER}
  \def\DBKrevname{NAME}
  \def\DBKrevdate{DATUM}
  \def\DBKcontrib{AKTION}
  \def\DBKsignature{UNTERSCHRIFT}
}
\langsetupdbk{fr}{
  \def\refname{R\'ef\'erences}%
  \def\abstractname{R\'esum\'e}%
  \def\bibname{Bibliographie}%
  \def\prefacename{Pr\'eface}%
  \def\chaptername{Chapitre}%
  \def\appendixname{Annexe}%
  \def\contentsname{Table des mati\`eres}%
  \def\listfigurename{Liste des figures}%
  \def\listtablename{Liste des tableaux}%
  \def\indexname{Index}%
  \def\figurename{{\scshape Figure }}%
  \def\tablename{{\scshape Tableau }}%

  \def\examplename{Exemple}
  \def\ondate{le}
  \renewcommand{\DBKreleaseinfo}{Document de Travail}
  \def\projname{PROJET}
  \def\titlename{TITRE}
  \def\writtenby{R\'EDIG\'E PAR}
  \def\DBKindname{NOM}
  \def\DBKindtitle{INDEXATION DU DOCUMENT}
  \def\DBKrevtitle{SUIVI DU DOCUMENT}
  \def\DBKrevdesc{MODIFICATIONS}
  \def\DBKrevnumber{INDICE}
  \def\DBKrevname{NOM}
  \def\DBKrevdate{DATE}
  \def\DBKcontrib{ACTION}
  \def\DBKsignature{SIGNATURE}
}
\langsetupdbk{nl}{
  \def\refname{Referenties}%
  \def\abstractname{Samenvatting}%
  \def\bibname{Bibliografie}%
  \def\prefacename{Voorwoord}%
  \def\chaptername{Hoofdstuk}%
  \def\appendixname{Appendix}%
  \def\contentsname{Inhoudstafel}%
  \def\listfigurename{Lijst van figuren}%
  \def\listtablename{Lijst van tabellen}%
  \def\indexname{Index}%
  \def\figurename{{\scshape Figuur }}%
  \def\tablename{{\scshape Tabel }}%

  \def\examplename{Voorbeeld}
  \def\ondate{}
  \renewcommand{\DBKreleaseinfo}{Werkdocument}
  \def\writtenby{GESCHREVEN DOOR}
  \def\projname{PROJECT}
  \def\titlename{TITEL}
  \def\DBKindname{NAAM}
  \def\DBKindtitle{MEDEWERKERS}
  \def\DBKrevtitle{HERZIENINGEN}
  \def\DBKrevdesc{BESCHRIJVING}
  \def\DBKrevnumber{NUMMER}
  \def\DBKrevname{NAAM}
  \def\DBKrevdate{DATUM}
  \def\DBKcontrib{ACTIE}
  \def\DBKsignature{Handtekening}
}
\langsetupdbk{es}{
  \def\refname{Referencia}%
  \def\abstractname{Resumen}%
  \def\bibname{Bibliografía}%
  \def\prefacename{Prefacio}%
  \def\chaptername{Capítulo}%
  \def\appendixname{Apéndice}%
  \def\contentsname{Índice de contenido}%
  \def\listfigurename{Índice de ilustraciones}%
  \def\listtablename{Índice de tablas}%
  \def\indexname{Índice de palabras clave}%
  \def\figurename{{\scshape Ilustración }}%
  \def\tablename{{\scshape Tabla }}%
   
  \def\examplename{Ejemplo}
  \def\ondate{}
  \renewcommand{\DBKreleaseinfo}{Documento de trabajo}
  \def\writtenby{ESCRITO POR}
  \def\projname{PROYECTO}
  \def\titlename{TÍTULO}
  \def\DBKindname{NOMBRE}
  \def\DBKindtitle{COLABORADORES}
  \def\DBKrevtitle{HISTORIAL DE REVISIONES}
  \def\DBKrevdesc{MODIFICACIONES}
  \def\DBKrevnumber{NÚMERO}
  \def\DBKrevname{NOMBRE}
  \def\DBKrevdate{FECHA}
  \def\DBKcontrib{ACCIÓN}
  \def\DBKsignature{FIRMA}
}
% Last-Translator: Giuseppe Sacco <eppesuig@debian.org>
% Translation-Team: Italian translation project <tp@lists.linux.it>
% Translation-Date: 2007-07-25
\langsetupdbk{it}{
  \def\refname{Nome}%
  \def\abstractname{Introduzione}%
  \def\bibname{Bibliografia}%
  \def\prefacename{Prefazione}%
  \def\chaptername{Capitolo}%
  \def\appendixname{Appendice}%
  \def\contentsname{Sommario}%
  \def\listfigurename{Indice delle figure}%
  \def\listtablename{Indice delle tavole}%
  \def\indexname{Indice}%
  \def\figurename{{\scshape Figura }}%
  \def\tablename{{\scshape Tavola }}%
 
  \def\examplename{Esempio}
  \def\ondate{l\`i}
  \renewcommand{\DBKreleaseinfo}{Documento di lavoro}
  \def\writtenby{A CURA DI}
  \def\projname{PROGETTO}
  \def\titlename{TITOLO}
  \def\DBKindname{NOME}
  \def\DBKindtitle{COLLABORATORI}
  \def\DBKrevtitle{CRONOLOGIA DELLE REVISIONI}
  \def\DBKrevdesc{DESCRIZIONE}
  \def\DBKrevnumber{POSIZIONE}
  \def\DBKrevname{NOME}
  \def\DBKrevdate{DATA}
  \def\DBKcontrib{AZIONE}
  \def\DBKsignature{FIRMA}
}
\langsetupdbk{en}{
  \def\examplename{Example}
  \def\ondate{on}
  \renewcommand{\DBKreleaseinfo}{Working Paper}
  \def\writtenby{WRITTEN BY}
  \def\projname{PROJECT}
  \def\titlename{TITLE}
  \def\DBKindname{NAME}
  \def\DBKindtitle{COLLABORATORS}
  \def\DBKrevtitle{REVISION HISTORY}
  \def\DBKrevdesc{DESCRIPTION}
  \def\DBKrevnumber{NUMBER}
  \def\DBKrevname{NAME}
  \def\DBKrevdate{DATE}
  \def\DBKcontrib{ACTION}
  \def\DBKsignature{SIGNATURE}
}
\langsetupdbk{ko}{
%  \usepackage{hfont}
  \hypersetup{unicode}
  \usepackage{CJKutf8}
}
\langsetupdbk{zh}{
  \hypersetup{unicode}
  \usepackage{CJKutf8}
  \usepackage{pinyin}
}
\langsetupdbk{ja}{
  \hypersetup{unicode}
  \usepackage{CJKutf8}
}

%% Define the babel setups in docbook
\babelsetup{fr}{%
  \NoAutoSpaceBeforeFDP
  % Avoid mess between enumitem and french redefinition
  \FrenchItemizeSpacingfalse
}

\babelsetup{es}{%
  % Avoid enumitem to crash with spanish babel
  \let\savees@listquot\es@listquot
  \def\es@listquot{\protect\savees@listquot}

  % Remove those horrible and messy "x shorthands
  \renewcommand\shorthandsspanish{}
}

\babelsetup{de}{%
  % Remove those messy "x shorthands
  \AtBeginDocument{\languageshorthands{none}}
}

%% Apply default locale setup
\setuplocale{en}

