locale: Don't assume 2-letter language codes.

Some languages have 3-letter codes. So instead of splitting the output
of QLocale::name, use QLocale::language and the static
QLocale::languageToString.
This commit is contained in:
Kevin Kofler 2014-11-25 19:41:01 +01:00
parent d2288d0961
commit bcbe5103b9

View File

@ -290,7 +290,7 @@ LocalePage::guessLCLocale()
QStringList linesForLanguage;
foreach ( QString line, m_localeGenLines )
{
if ( line.startsWith( myLocale.name().left( 2 ) ) )
if ( line.startsWith( QLocale::languageToString( myLocale.language() ) ) )
linesForLanguage.append( line );
}