# Package exercise: change “exercise” to French “exercice”

I am preparing a homework for my students with LaTeX, so I used \usepackage{exercise}. In the .pdf file I got "exercise" and I want it to be in French (exercice) not English.

I put \usepackage[french]{babel} but nothing changed.

Here is my code:

\documentclass[12pt,a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[french]{babel}
\usepackage{exercise}

\begin{document}
\maketitle

\begin{Exercise}[title=...]

\Question{....}

\end{Exercise}


On exercise documentation (§5.2), you can see how the text "constants" (e.g. List of exercises, Exercise, Answer of exercise, ...) are defined. It is done through following macros, respectively:

\def\listexercisename{List of exercises}%
\def\ExerciseName{Exercise}%
...


Thus, you can use following macro to adapt them according to your needs:

\renewcommand{\ExerciseName}{Exercice}


However, for some languages (spanish, italian, dutch... and french), Paul Pichaureau (creator of this package) already did this work. This should be done automatically when you load a language in babel; but how?
You can see (in the same paragraph), that exercise recognise the language loaded via this command: \@ifpackageloaded{babel}{\addto{\captions<LANGUAGE>}{....

In the case of french language, the command is: \addto{\captionsfrenchb}{, thus you should load the frenchb option (and not french) of babel-package to make exercise automatically translate macros in french. → if this works for most languages (at least spanish, dutch, and italian), it now doesn't seem to work with neither french, nor frenchb.

TL;DR: To translate the names in french, you have two one solutions:

• translate each of them manually via \renewcommand{\ExerciseName}{Nouveau nom de mes exercices}-like commands.
• load the frenchb option in babel (and not the french one): already implemented translations will be automatically used;

Edit: With most recent (i.e. post TeXlive 2012) LaTeX distro, neither frenchb nor french options in babel seem to work with automated translation of exercice package (cf. Exercise package with Babel). You should then copy-paste these lines into your .tex files to emulate the translation:

\renewcommand\listexercisename{Liste des exercices}%
\renewcommand\ExerciseName{Exercice}%

The simplest perhaps: line 74 of exercise.sty, replace addto{\captionsfrenchb} with addto{\captionsfrench}.