%D \module
%D   [      file=t-french,
%D        version=2010.02.09,
%D          title=\CONTEXT\ User Module,
%D       subtitle=For French documents,
%D         author=Peter Münster,
%D           date=\currentdate,
%D      copyright={Peter Münster}]
%C This module is copyrighted by Peter Münster.
%C Please send any comments to pmrb at free.fr.
%C You can find the latest version of this module on
%C http://modules.contextgarden.net/

% This program is free software; you can redistribute it and/or
% modify it under the terms of the GNU General Public License
% as published by the Free Software Foundation; either version 2
% of the License, or (at your option) any later version.

% This program is distributed in the hope that it will be useful,
% but without any warranty; without even the implied warranty of
% merchantability or fitness for a particular purpose.  See the
% GNU General Public License for more details.

%D This module tries to do similar things as the frenchb.ldf in LaTeX:
%D \startitemize
%D \item automatic space before » and after «, :, ?, ; and ! 
%D \item changing symbol for itemize environment
%D \item itemize environment packed
%D \item first paragraph of section indented
%D \item \type{\Bsc{}} macro
%D \stopitemize

\writestatus{loading}{Typesetting French documents}
\doifnotmode{mkiv}{\writestatus{error}{needs MKIV}\wait\end}

\setcharacterspacing[frenchpunctuation]
\setupitemize[symbol=2]
\setupitemize[packed]
\setupheads[indentnext=yes]
\setupindenting[yes, medium]
\lccode`\'=`\'

\mainlanguage[fr]

\ifx \ieme  \undefined \def\ieme  {\highordinalstr{e}}   \fi
\ifx \iemes \undefined \def\iemes {\highordinalstr{es}}  \fi
\ifx \ier   \undefined \def\ier   {\highordinalstr{er}}  \fi
\ifx \iere  \undefined \def\iere  {\highordinalstr{re}}  \fi
\ifx \iers  \undefined \def\iers  {\highordinalstr{ers}} \fi
\ifx \ieres \undefined \def\ieres {\highordinalstr{res}} \fi

\def\Bsc#1{\dontleavehmode\hbox{\sc#1}}

\doifnotmode{demo}{\endinput}

%D Usage example:
\def\myItems{%
  \startitemize
  \item test
  \item test
    \startitemize
    \item test
    \item test
      \startitemize
      \item test
      \item test
      \stopitemize
    \stopitemize
  \stopitemize}

\usemodule[french]

\starttext
Voilà: Voilà? Voilà! Voilà;
{\en some english text: «English» or \quotation{French}, ok?}
«voilà» \quote{voilà} \quotation{voilà}
\myItems
\en
\myItems
\stoptext
