How to change the title of ToC?

by using \renewcommand{\contentsname}{Whatever}

However, it does not seem to work with lyx, neither in the preamble nor as ERT
The package being used is babel.

## Minimum working example of .lyx file:

\pagenumbering{roman}
\renewcommand{\chaptername}{}

\renewcommand{\thechapter}{\arabic{chapter}}

\renewcommand{\contentsname}{Innholdsfortegnelse}

1. Innledning

\pagenumbering{arabic}

Heisann


1. Document > Settings... > Language > Language package: None

2. Document > Settings... > LaTeX Preamble >

Write:

\usepackage[norsk]{babel}
\renewcommand{\contentsname}{Innholdsfortegnelse}}


The result must be the equivalent to this plain LaTeX:

\documentclass{article}
\usepackage[norsk]{babel}
\renewcommand{\contentsname}{Innholdsfortegnelse}}
\begin{document}
\tableofcontents
\section{Section}
\end{document}


If doing this you got a Package babel Error: Unknown languagexxxxx':

Then, go to View Complete Log ...

As you can see, this is because there are an \select@language {english} in the .aux file of the previous run. You can remove it manually (in the case of the screenshot in a Linux system it was /tmp/lyx_tmpdir.T23297/lyx_tmpbuf6/newfile6.aux`) but you can just click on Close and LyX will clean the auxiliary files for you (at least if there are only this error). In next run it should work.