I'm trying this code copied from another post in TEX.SX
with the Spanish option, but some words appear in English, e.g. WHILE, FOR,… IF,…
Is it possible to change these to Spanish?
\documentclass[12pt,a4paper,x11names]{article}
%\renewcommand{\baselinestretch}{1.5} % interlineado de 1.5de la normativa del TFG no usamos esto para poder usar el setspace y que el interlineado no afecte a las notas a íé de página.
\usepackage[top=2.5cm, left=3.5cm, bottom=2.5cm, right=2.5cm]{geometry} % Margenes de la normativa TFG
\usepackage{setspace}
\usepackage{lipsum,mwe}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[spanish]{babel}
\usepackage{mathtools,amsmath,amsfonts,amssymb,latexsym}
\usepackage{eurosym}
\usepackage{graphicx}
\usepackage[ruled,vlined,lined,linesnumbered,spanish]{algorithm2e}
\begin{document}
\begin{algorithm}[H]
\caption{Algoritmo del Enfiramiento Simulado}
\KwData{la liste $L$ des naturels compris de $2$ à $N$.}
\KwResult{la liste $P$ des nombres premiers compris entre $2$ et $N$.}
\BlankLine
\For{$i = 2$ \KwTo $N$}{
\If{$i$ n'est pas barré dans la liste $L$}{
Barrer dans la liste $L$ les mutltiples $ki$ où $k \geq 2$.
}
}
\Return{la liste $P$ des nombres non barrés.}
\end{algorithm}
%\begin{algorithm}[h]
%\SetLine
%\linesnumbered
%\KwData{$\{ T_0,T_1,...,T_{imax}=T_{final}\}$}
%\end{algorithm}
\end{document}
Best Answer
Spanish is not supported out of the box, I'm afraid.
Here's what you should redefine; I leave the translation into Portuguese as found in the package, so Spanish people can adjust it (I marked this as Community Wiki).
For reference, I add also the English translations