kdelibs3/kdelibs-3.5.6-lang.patch
2007-07-30 20:10:08 +00:00

18 lines
662 B
Diff

--- kdelibs-3.5.6/kdecore/klocale.cpp.orig 2007-05-22 17:49:31.000000000 +0200
+++ kdelibs-3.5.6/kdecore/klocale.cpp 2007-05-23 20:37:54.000000000 +0200
@@ -140,9 +140,11 @@ void KLocale::initLanguageList(KConfig *
KConfigGroupSaver saver(config, "Locale");
m_country = config->readEntry( "Country" );
- if ( m_country.isEmpty() )
- m_country = defaultCountry();
-
+ if ( m_country.isEmpty() ) {
+ QString ln, ct, chrset;
+ splitLocale(QString(::getenv("LANG")), ln, ct, chrset);
+ m_country = (ct.isEmpty()) ? defaultCountry() : ct.lower();
+ }
// Reset the list and add the new languages
QStringList languageList;
if ( useEnv )