Fix system locale string + allow 3 letter language codes.

This commit is contained in:
Teo Mrnjavac 2014-11-26 11:24:39 +01:00
parent 8c037db21a
commit 88dfd7fa10

View File

@ -154,7 +154,7 @@ LocalePage::LocalePage( QWidget* parent )
!dlg->selectedLCLocale().isEmpty() )
{
m_selectedLocale = dlg->selectedLCLocale();
m_localeLabel->setText( tr( "The system encoding is set to %1." )
m_localeLabel->setText( tr( "The system locale is set to %1." )
.arg( prettyLCLocale( m_selectedLocale ) ) );
}
@ -165,7 +165,7 @@ LocalePage::LocalePage( QWidget* parent )
m_regionLabel->setText( tr( "Region:" ) );
m_zoneLabel->setText( tr( "Zone:" ) );
m_localeLabel->setText( tr( "The system encoding is set to %1." )
m_localeLabel->setText( tr( "The system locale is set to %1." )
.arg( prettyLCLocale( lcLocale() ) ) );
m_localeChangeButton->setText( tr( "&Change..." ) );
@ -298,11 +298,10 @@ LocalePage::guessLCLocale()
if ( m_localeGenLines.isEmpty() )
return "en_US.UTF-8 UTF-8";
QString myLanguage = QLocale::languageToString( myLocale.language() );
QStringList linesForLanguage;
foreach ( QString line, m_localeGenLines )
{
if ( line.startsWith( myLanguage ) )
if ( line.startsWith( myLocale.name().split( '_' ).first() ) )
linesForLanguage.append( line );
}