I use this document class abntex2 from: https://ctan.org/pkg/abntex2?lang=en, but when I generate this:
\documentclass[12pt]{abntex2}
\renewcommand{\listfigurename}{Lista de Figuras}
\begin{document}
\listoffigures*
\end{document}
The list of figures name is not overwritten by Lista de Figuras, it still Lista de Ilustrações:
It only works if I put \renewcommand{\listfigurename}{Lista de Figuras} inside the document like this:
\documentclass[12pt]{abntex2}
\begin{document}
\renewcommand{\listfigurename}{Lista de Figuras}
\listoffigures*
\end{document}
Why I cannot override it?
Looking at the abntex2 code, I see they redefine the command:
\renewcommand{\listfigurename}{Lista de ilustra\c{c}\~{o}es}
How to override the \listfigurename on my preamble, after the abntex class inclusion?
Extra
If someone is wondering how I switch between English and Portuguese this is how:
\documentclass[12pt]{abntex2}
\usepackage[utf8]{inputenc}
\newif\ifenglish\englishfalse
% \englishtrue
\newcommand{\lang}[2]{\ifenglish#1\else#2\fi}
\ifenglish
\PassOptionsToPackage{language=english}{biblatex}
\PassOptionsToPackage{brazil,main=english,spanish,french}{babel}
\else
\PassOptionsToPackage{language=brazil}{biblatex}
\PassOptionsToPackage{main=brazil,english,spanish,french}{babel}
\fi
\begin{document}
\section{\lang{English Section}{Seção em Português}}
\lang{Section contents.}{Conteúdo da seção.}
\end{document}
Which generates the following PDF in Portuguese:
If I uncomment the \englishtrue, then, the generated PDF document will be in English as follows:






\addto\captionsbrazil{\renewcommand{\listfigurename}{My List}}. – David Purton Apr 01 '19 at 04:36englishandportuguesefor babel with\newcommand{\lang}[2]{\ifenglish#1\else#2\fi}: Is it possible to keep my translation together with original text? - I added this\addto\captionsbrazilon my preamble and it worked. – user Apr 02 '19 at 00:54