%% This file is part of the ANTOMEGA project version 0.6
%% -----------------------------------------------------
%% 
%% It may be distributed under the terms of the LaTeX Project Public
%% License, as described in lppl.txt in the base LaTeX distribution.
%% Either version 1.0 or, at your option, any later version.
%% Copyright (C) 2001 -- 2003 by Alexej Kryukov
%% Please report errors to: A.M. Kryukov <basileia@yandex.ru>

\makeatletter

\LoadOCPByName{\UppercaseNoAccents}{uppercase-no-accents}

\ifx\l@french\@undefined
   \ant@nopatterns{French}
   \adddialect\l@french0
\fi

\ifx\westernrm\undefined\let\westernrm=\rmdefault\fi
\ifx\westernsf\undefined\let\westernsf=\sfdefault\fi
\ifx\westerntt\undefined\let\westerntt=\ttdefault\fi

\ifx\westernencoding\undefined\let\westernencoding=\uniencoding\fi

\def\french@font{\fontfamily{\westernrm}%
   \fontencoding{\westernencoding}\selectfont%
   \let\rmdefault=\westernrm\let\sfdefault=\westernsf%
   \let\ttdefault=\westerntt\let\encodingdefault=\westernencoding}

\def\tmp@uni{unicode}
\def\tmp@omega{omega}
\def\tmp@tex{tex}
\ifx\eventualEuOutput\undefined
   \def\eventualEuOutput{\protect\pushocplist\LatinUniOutOCP}
\fi

\def\tmp@ucs{ucs-2}
\def\tmp@utf{utf-8}
\def\eventualFrPunct{\protect\pushocplist\BasicTexOCP}
\def\eventualFrShorthands{\protect\pushocplist\BasicBabelOCP}
\def\eventualFrInput{\protect\pushocplist\BasicInputOCP}
\def\eventualFrAccents{\protect\pushocplist\BasicAccentsOCP}

\def\french@OCP{\protect\clearocplists%
   \eventualFrInput%
   \eventualFrPunct%
   \eventualFrShorthands%
   \eventualFrAccents%
   \eventualEuOutput}

\define@key{french}{input}[ucs-2]{%
   \def\@tmpa{#1}%
   \ifx\@tmpa\tmp@utf\def\eventualFrInput{%
      \protect\pushocplist\BasicInputUtfOCP}%
      \typeout{Option: French input encoding=utf-8}%
   \ifx\@tmpa\tmp@iso\def\eventualFrInput{%
      \protect\pushocplist\BasicInputIsoOCP}%
      \typeout{Option: French input encoding=iso-8859-1}%
   \ifx\@tmpa\tmp@win\def\eventualFrInput{%
      \protect\pushocplist\BasicInputWinOCP}%
      \typeout{Option: French input encoding=windows-1252}%
   \else\def\eventualFrInput{%
      \protect\pushocplist\BasicInputUcsOCP}%
      \typeout{Option: French input encoding=ucs-2}
   \fi\fi\fi}

\define@key{french}{shorthands}[on]{%
   \def\@tmpa{#1}%
   \ifx\@tmpa\opt@enabled\def\eventualFrShorthands{%
      \protect\pushocplist\BasicBabelOCP}%
      \typeout{Option: Shorthands for French text enabled}%
   \else\def\eventualFrShorthands{}%
      \typeout{Option: Shorthands for French text disabled}%
   \fi}

\define@key{french}{output}[unicode]{%
   \def\@tmpa{#1}%
   \ifx\@tmpa\tmp@tex\def\eventualEuOutput{%
      \protect\pushocplist\LatinTexOutOCP}%
      \def\westernencoding{T1}%
   \else\ifx\@tmpa\tmp@omega\def\eventualEuOutput{%
      \protect\pushocplist\LatinOmegaOutOCP}%
      \def\westernencoding{UT1}%
   \else\def\eventualEuOutput{%
      \protect\pushocplist\LatinUniOutOCP}%
      \def\westernencoding{UT1}%
   \fi\fi}

\def\french@punctuation{%
   \frenchspacing%
   \def\QuestionMark{\unskip\kern.1667em?}%
   \def\ExclamationMark{\unskip\kern.1667em!}%
   \def\Semicolon{\unskip\kern.1667em;}%
   \def\Colon{\unskip\kern.1667em:}}

\def\nofrench@punctuation{%
   \nonfrenchspacing%
   \LeftPointingDoubleAngleQuotationMark{^^^^00ab}%
   \RightPointingDoubleAngleQuotationMark{^^^^00bb}%
   \def\QuestionMark{?}%
   \def\ExclamationMark{!}%
   \def\Semicolon{;}%
   \def\Colon{:}}

\def\french@guillemots{%
   \def\LeftPointingDoubleAngleQuotationMark{^^^^00ab\kern.1667em}%
   \def\RightPointingDoubleAngleQuotationMark{\unskip\kern.1667em^^^^00bb}%
}

\newcounter{niveauguillemets}[paragraph]

\def\tmp@normal{normal}
\def\tmp@paragraphe{paragraphe}
\def\tmp@ligne{ligne}

\define@key{french}{guillemets}[normal]{
   \def\@tmpa{#1}
   \ifx\@tmpa\tmp@ligne%
      \def\french@guillemots{%
      \def\LeftPointingDoubleAngleQuotationMark{^^^^00ab\kern.1667em\setcounter{niveauguillemets}{1}%
      \ifthenelse{\value{niveauguillemets} = 1}{\localleftbox{^^^^00ab\kern.1667em}}%
      {\everypar={{^^^^00ab}\kern.1667em}\setcounter{niveauguillemets}{1}}}%
      \def\RightPointingDoubleAngleQuotationMark{\unskip\kern.1667em^^^^00bb%
      \everypar={}\localleftbox{}}}%
   \else\ifx\@tmpa\tmp@paragraphe%
      \def\french@guillemots{\def\LeftPointingDoubleAngleQuotationMark{^^^^00ab\kern.1667em%
      \everypar={^^^^00ab\kern.1667em}}\def\RightPointingDoubleAngleQuotationMark%
      {\unskip\kern.1667em^^^^00bb\everypar={}}}%
   \else\ifx\@tmpa\tmp@normal%
      \def\french@guillemots{\def\LeftPointingDoubleAngleQuotationMark{^^^^00ab\kern.1667em}%
      \def\RightPointingDoubleAngleQuotationMark{\unskip\kern.1667em^^^^00bb}}%
\fi\fi\fi}

\def\tmp@avec{avecaccents}
\def\tmp@sans{sansaccents}

\define@key{french}{majuscules}[avecaccents]{%
   \def\@tmpa{#1}%
   \ifx\@tmpa\tmp@sans%
      \ocplist\UppercaseOCP=
         \addbeforeocplist 3000 \UppercaseNoAccents
      \nullocplist\typeout{Option: majuscules=avecaccents}%
   \else%
      \typeout{Option: majuscules=sansaccents}%
   \fi}

\def\french@captions{%
   \def\refname{\localfrench{R^^^^00e9f^^^^00e9rences}}%
   \def\abstractname{\localfrench{R^^^^00e9sum^^^^00e9}}%
   \def\bibname{\localfrench{Bibliographie}}%
   \def\prefacename{\localfrench{Pr^^^^00e9face}}%
   \def\chaptername{\localfrench{Chapitre}}%
   \def\appendixname{\localfrench{Annexe}}%
   \def\contentsname{\localfrench{Table des mati^^^^00e8res}}%
   \def\listfigurename{\localfrench{Table des figures}}%
   \def\listtablename{\localfrench{Liste des tableaux}}%
   \def\indexname{\localfrench{Index}}%
   \def\figurename{\localfrench{\scshape Fig.}}%
   \def\tablename{\localfrench{\scshape Tab.}}%
   \def\@Fpt{\ifcase\value{part}\or Premi^^^^00e8re\or Deuxi^^^^00e8me\or%
   Troisi^^^^00e8me\or Quatri^^^^00e8me\or Cinqui^^^^00e8me\or Sixi^^^^00e8me\or%
   Septi^^^^00e8me\or Huiti^^^^00e8me\or Neuvi^^^^00e8me\or Dixi^^^^00e8me\or Onzi^^^^00e8me\or%
   Douzi^^^^00e8me\or Treizi^^^^00e8me\or Quatorzi^^^^00e8me\or Quinzi^^^^00e8me\or%
   Seizi^^^^00e8me\or Dix-septi^^^^00e8me\or Dix-huiti^^^^00e8me\or Dix-neuvi^^^^00e8me\or%
   Vingti^^^^00e8me\fi\space}%
   \def\thepart{}%
   \def\partname{\localfrench{\protect\@Fpt partie}}%
   \def\pagename{\localfrench{page}}%
   \def\seename{\localfrench{\emph{voir}}}%
   \def\alsoname{\localfrench{\emph{voir aussi}}}%
   \def\enclname{\localfrench{P.~J. }}%
   \def\ccname{\localfrench{Copie ^^^^00e0 }}%
   \def\headtoname{}%
   \def\proofname{\localfrench{D^^^^00e9monstration}}% for AMS-\LaTeX
   \def\today{\localfrench{\number\day%
      \ifnum1=\day \ier\fi%
      \space \ifcase\month%
      \or janvier\or f^^^^00e9vrier\or mars\or avril\or mai\or juin\or%
      juillet\or ao^^^^00fbt\or septembre\or octobre\or novembre\or%
      d^^^^00e9cembre\fi%
      \space \number\year}}}

\def\french@language{\protect\language=\l@french}

\def\noextras@french{%
   \nofrench@punctuation}

\def\blockextras@french{%
   \french@language%
   \local@hyphenmins{french}{2}{2}%
   \french@punctuation%
   \french@captions%
   \local@marks{french}%
   \french@OCP%
   \french@guillemots%
   \french@font}

\def\inlineextras@french{%
   \french@language%
   \local@hyphenmins{french}{2}{2}%
   \french@punctuation%
   \french@OCP%
   \french@guillemots%
   \french@font}

\endinput
