From 88dfd7fa109bc8dc7382dab85c01d319df1e426f Mon Sep 17 00:00:00 2001 From: Teo Mrnjavac Date: Wed, 26 Nov 2014 11:24:39 +0100 Subject: [PATCH] Fix system locale string + allow 3 letter language codes. --- src/modules/locale/LocalePage.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/modules/locale/LocalePage.cpp b/src/modules/locale/LocalePage.cpp index 58353e11b..4d09ae097 100644 --- a/src/modules/locale/LocalePage.cpp +++ b/src/modules/locale/LocalePage.cpp @@ -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 ); }