My document is in French. I added appendices to the document, appendices use \chapter{}, hence I would like that these chapters to be names "Annexe" (which is the French word for "Appendice" in table of content.
But I my current document I don't manage to do that.
I expect it has to do with the cutomization of my table of content. Which I want to keep as well.
working example:
%Preamble
\documentclass[a4paper,french,oneside,openright]{book}
\usepackage[french]{babel}
\usepackage{hyperref}
\hypersetup{
colorlinks=true,
linkcolor=blue,
filecolor=magenta,
urlcolor=cyan
}
\usepackage{lastpage}
\usepackage{lipsum}
\usepackage{tocloft,calc}
\renewcommand{\cftchappresnum}{Chapitre }
\AtBeginDocument{\addtolength\cftchapnumwidth{\widthof{\bfseries Chapitre }}}
\usepackage{datetime}
\usepackage[toc]{appendix}
\begin{document}
\tableofcontents
\part{main}
\chapter{Lorem ipsum}
\lipsum[1-2]
\renewcommand{\appendixname}{Annexe}
\renewcommand{\appendixtocname}{Annexe}
\renewcommand{\appendixpagename}{Annexe}
\part{appendices}
\begin{appendices}
\chapter{Some appendice}
\lipsum[1-2]
\chapter{Some appendice}
\lipsum[1-2]
\end{appendices}
\end{document}
I know that this question has been closed and pointing to \chaptername is used even for appendix chapters in ToC but that didn't help me at all. Another answer is marked as solutions under this question. That one helped me solve the issue.


babelmanual you need to add your name changes to the language it self somthing like\addto\captionsfrench{.....}where you supply the...part – daleif Jun 15 '21 at 08:40renewcommandofcftchappresnum.) – Markus G. Jun 15 '21 at 09:03hyperrefpackage LAST, unless another package specificially and explicitly requires being loaded afterhyperref. – Markus G. Jun 15 '21 at 09:05