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:
parent
d2288d0961
commit
bcbe5103b9
@ -290,7 +290,7 @@ LocalePage::guessLCLocale()
|
|||||||
QStringList linesForLanguage;
|
QStringList linesForLanguage;
|
||||||
foreach ( QString line, m_localeGenLines )
|
foreach ( QString line, m_localeGenLines )
|
||||||
{
|
{
|
||||||
if ( line.startsWith( myLocale.name().left( 2 ) ) )
|
if ( line.startsWith( QLocale::languageToString( myLocale.language() ) ) )
|
||||||
linesForLanguage.append( line );
|
linesForLanguage.append( line );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user