Capitalize French part name

The french babel support tries to ensue that constructs like \partname~\thepart automatically get translated into "Première partie" by (locally) changing \thepart to suppress the number. This fails in your example because the \MakeUppercase make the local redefinition end before \thepart gets invoked. This can be avoided by moving \thepart into it's argument and protecting it:

Change {\MakeUppercase{\partname}~\thepart} to {\MakeUppercase{\partname~\protect\thepart}} to get "Première partie".

You can also locally redefine \frenchpartname to ensure that it works with \MakeUppercase:





to get "PARTIE I".

The command \partname is defined to do complicated things that in your case are not needed.



\titleclass{\part}{top} % make part like a chapter


%\selectlanguage{french} % French is already default



enter image description here

A couple of notes: titlesec prefers \filleft to \raggedleft. There's no need to use explicit: the last token in the final mandatory argument to \titleformat is eventually followed by the braced title, so it can be a one-argument macro.

Actually, I usually discourage using explicit: better defining a separate macro that does what we want rather than clutter the argument to \titleformat with code.