[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE_3_2_BRANCH: kdelibs/kdecore
From:       Adriaan de Groot <groot () kde ! org>
Date:       2004-06-15 18:05:14
Message-ID: 20040615180514.79579996F () office ! kde ! org
[Download RAW message or body]

CVS commit by adridg: 

Allow languages to override the locale setting for noun declension and such - makes \
inflected languages work out gramatically in non-inflected locales (ie. Czech while \
in Holland)


  M +15 -4     klocale.cpp   1.344.2.2


--- kdelibs/kdecore/klocale.cpp  #1.344.2.1:1.344.2.2
@@ -318,6 +318,4 @@ void KLocale::initFormat()
                      m_negativeMonetarySignPosition, SignPosition);
 
-  //Grammatical
-  readConfigBoolEntry("NounDeclension", false, d->nounDeclension);
 
   // Date and time
@@ -325,6 +323,4 @@ void KLocale::initFormat()
   readConfigEntry("DateFormat", "%A %d %B %Y", m_dateFormat);
   readConfigEntry("DateFormatShort", "%Y-%m-%d", m_dateFormatShort);
-  readConfigBoolEntry("DateMonthNamePossessive", false,
-                      d->dateMonthNamePossessive);
   readConfigNumEntry("WeekStartDay", 1, d->weekStartDay, int);
 
@@ -337,4 +333,19 @@ void KLocale::initFormat()
   d->calendar = 0; // ### HPB Is this the correct place?
 
+  //Grammatical
+  //Precedence here is l10n / i18n / config file
+  KSimpleConfig language(locate("locale",
+                                QString::fromLatin1("%1/entry.desktop")
+                                .arg(m_language)), true);
+  language.setGroup("KCM Locale");
+#define read3ConfigBoolEntry(key, default, save) \
+  save = entry.readBoolEntry(key, default); \
+  save = language.readBoolEntry(key, save); \
+  save = config->readBoolEntry(key, save);
+
+  read3ConfigBoolEntry("NounDeclension", false, d->nounDeclension);
+  read3ConfigBoolEntry("DateMonthNamePossessive", false,
+                       d->dateMonthNamePossessive);
+
   // end of hack
   KGlobal::_locale = lsave;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic