theforeman/foreman — pull request #900 by lzap (2013-09-20 13:31:40+00:00)
Title: fixes #3077 - locale was set to last language by default

So during initialization we are switching current locale into all available
languages to fetch translation of all human readable language names. There
was a bug when default language was set before this loop, so for users in
1.3 RC1 locale was always set to last available language (usually Chinese).