[Tex/LaTex] algorithm2e – Different ending words for switch and case blocks

algorithm2e

In the following MWE, I would like the end of switch to be different from the ends of case and other. Is it possible ?

\documentclass{article}
    \usepackage{algorithm2e}

\begin{document}

\begin{algorithm}
    \Begin{
        \Switch{X}{
            \Case{1}{
                \While{Continue}{Action}
            }
            \Other{Other}
        }
    }
\end{algorithm}

\end{document} 

Best Answer

enter image description here

It appears to be easier to change it for Case than Otherwise, but this seems to work:

\documentclass{article}
    \usepackage[longend]{algorithm2e}
\makeatletter

\SetKwFor{Case}{case}{}{end case}%

\renewcommand\algocf@Other[1]{%
\KwSty {otherwise}\algocf@block {#1}{\@algocf@endoption {end other}}}

\makeatother

\begin{document}

\begin{algorithm}
    \Begin{
        \Switch{X}{
            \Case{1}{
                \While{Continue}{Action}
            }
            \Other{Other}
        }
    }
\end{algorithm}


\end{document}