kdelibs/kdelibs-3.5.6-lang.patch

18 lines
662 B
Diff
Raw Normal View History

--- 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 )