How to change the order of algorithm number and name in algorithm2e?

I have to write an algorithm in Hungarian, where the caption must look like:

1.3. Algoritmus: caption of alg

Algorithm 1.3: caption of alg.

Until now I had no problem as the package babel was doing all the work, but changing from algorithm-algorithmic to the algorithm2e package, it fails.

Anyone know the way to do so?

-
–  Claudio Fiandrino Jan 23 '13 at 15:35

You can redefine an internal macro of algorithm2e, namely \fnum@algocf. Put

\makeatletter
\renewcommand{\fnum@algocf}{\AlCapSty{\AlCapFnt\thealgocf\nobreakspace\algorithmcfname}}
\makeatother


\documentclass{article}
\usepackage{algorithm2e}

\makeatletter
\renewcommand{\fnum@algocf}{\AlCapSty{\AlCapFnt\thealgocf\nobreakspace\algorithmcfname}}
\makeatother

\begin{document}

\begin{algorithm}[H]
\SetAlgoLined
\KwData{this text}
\KwResult{how to write algorithm with \LaTeX2e }
initialization\;
\While{not at end of this document}{
\eIf{understand}{
go to next section\;
current section becomes this one\;
}{
go back to the beginning of current section\;
}
}
\caption{How to write algorithms}
\end{algorithm}

\end{document}

-
Thanks a lot, it does the job. To be perfect I corrected it by adding the dot after the numbering: \renewcommand{\fnum@algocf}{\AlCapSty{\AlCapFnt\thealgocf.\nobreakspace\algorit‌​hmcfname}} –  Boglárka G.-Tóth Jan 23 '13 at 16:04