How to modify \part names?

I'd like to modify the way parts are named, into my toc, in the same way they are named in the body of my document:

Première partie

For the first part.

Deuxième partie

For the second part, and so on. How could I do that? This is my MWE:

\documentclass[fontsize=11pt,%
twoside=semi,%
chapterprefix=true,%
listof=flat]%
{scrbook}
\usepackage[utf8]{inputenc}% can be removed with an uptodate TeX distribution
\usepackage[T1]{fontenc}
\usepackage [french]{babel}
\usepackage{fontspec}
\setmainfont{Didot}
\usepackage{lipsum}
\renewcommand*{\chapterformat}{%
\mbox{\chapappifchapterprefix{\nobreakspace}\thechapter
\IfUsePrefixLine{}{\enskip}}%
}

\begin{document}

\tableofcontents

\part{Éléments d'analyse}

\chapter{Définitions}

\lipsum

\end{document}
• You should take a look at titlesec and the fmtcount package, which has an \ordinal{counter}command – Bernard Jul 2 at 17:45

You can redefine the KOMA-Script command \addparttocentry:

\IfArgIsEmpty{#1}
{\csname ordinal\romannumeral\value{part}\endcsname\space\partnameord}% copied from french.ldf
{#2}%
}%
}%
\RedeclareSectionCommand[tocdynnumwidth]{part}% adjust the space for part number in TOC

Example:

\documentclass[%fontsize=11pt,% default
twoside=semi,%
chapterprefix=true,%
listof=flat]%
{scrbook}

\usepackage[T1]{fontenc}
\usepackage [ngerman,french]{babel}
\usepackage{fontspec}
%\setmainfont{Didot}% I do not have this font
\usepackage{lipsum}
\renewcommand*{\chapterformat}{%
\mbox{\chapappifchapterprefix{\nobreakspace}\thechapter
\IfUsePrefixLine{}{\enskip}}%
}

\IfArgIsEmpty{#1}
{\csname ordinal\romannumeral\value{part}\endcsname\space\partnameord}% copied from french.ldf
{#2}%
}%
}%
\RedeclareSectionCommand[tocdynnumwidth]{part}% adjust the space for part number in TOC

\begin{document}
\tableofcontents
\part{Éléments d'analyse}\label{p}
\chapter{Définitions}
\lipsum
\end{document}

Run three times to get:
{"ft_lang_label":"__label__en","ft_lang_prob":0.5167688,"math_prob":0.43588287,"size":860,"snap":"2019-43-2019-47","text_gpt3_token_len":269,"char_repetition_ratio":0.12616822,"word_repetition_ratio":0.0,"special_character_ratio":0.23255815,"punctuation_ratio":0.10526316,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.97331214,"pos_list":[0,1,2],"im_url_duplicate_count":[null,1,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2019-10-14T03:06:40Z\",\"WARC-Record-ID\":\"<urn:uuid:7a1d9add-1544-469e-928e-f72b737f82b1>\",\"Content-Length\":\"138981\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:e3901009-94b1-4b73-b5da-f55deb92eaf5>\",\"WARC-Concurrent-To\":\"<urn:uuid:97568bbf-7b8b-4f66-b0ba-3644fbbac328>\",\"WARC-IP-Address\":\"151.101.1.69\",\"WARC-Target-URI\":\"https://tex.stackexchange.com/questions/498379/how-to-modify-part-names\",\"WARC-Payload-Digest\":\"sha1:SNALBB5OG4GRL7D35YQUORKMHOU6R7I6\",\"WARC-Block-Digest\":\"sha1:EIIDTOGC4WEKIMTDWKXBZN2HFBP6J7NC\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2019/CC-MAIN-2019-43/CC-MAIN-2019-43_segments_1570986649035.4_warc_CC-MAIN-20191014025508-20191014052508-00351.warc.gz\"}"}