I've loaded babel in my .sty file like this:


Then at .tex or at the same .sty file I am trying to:


And the result is:

russian => rus (\languagename says russian)  OK!
ukrainian => rus (!!!) (languagename says ukrainian) WRONG!
english => eng (\languagename says english) OK!

What a magic it is? Note: everything else like word "Content", "Chapter" and so on are correctly translates to specified language.


1 Answer 1


This is a bug in babel, which appears when two cyrillic languages are chosen. I wrote about it in an article published in number 9 of ArsTeXnica, the journal of GuIT, the Italian TeX users group.

You can get around the bug by correcting the behaviour of babel:


\let\Bul\Bulgarian \let\Bg\Bulgarian 

\languagename --\the\language --%

\languagename --\the\language --%

\languagename --\the\language --%


enter image description here

With this code the declaration \Russian and \Ukrainian don't change the fixed words (they behave like the otherlanguage* environment); if you prefer to have the (IMO wrong) behavior of babel, change the occurrences of \foreign@language into \select@language.

The problem is that at loading time, each language defines \cyrillictext to use that language; so the last language loaded wins. When \selectlanguage or a similar command to select a cyrillic language is issued, \cyrillictext is executed as part of \extras<language>; so the language name is set correctly, but the language number is set instead to the cyrillic language last loaded in with babel, in the example case to Russian.

  • 1
    Great article. If you I have found more bugs, please report them for them to get fixed. Nov 1, 2012 at 7:41
  • @JavierBezos I've sent a bug report at LaTeX Project
    – egreg
    Nov 1, 2012 at 19:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .