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

List:       kde-commits
Subject:    [kde-workspace] plasma/generic/applets/system-monitor: Translate
From:       Shaun Reich <shaun.reich () kdemail ! net>
Date:       2012-01-10 19:40:38
Message-ID: 20120110194038.6D86CA60A6 () git ! kde ! org
[Download RAW message or body]

Git commit e2d5499535db04af9e9506424d62a6b4b6e39dbb by Shaun Reich.
Committed on 10/01/2012 at 20:38.
Pushed by sreich into branch 'master'.

Translate "swap" and "physical" properly in ram config dialog

Hopefully all of this will translate properly.

BUG: 241852

M  +24   -6    plasma/generic/applets/system-monitor/ram.cpp

http://commits.kde.org/kde-workspace/e2d5499535db04af9e9506424d62a6b4b6e39dbb

diff --git a/plasma/generic/applets/system-monitor/ram.cpp b/plasma/generic/applets/system-monitor/ram.cpp
index ec7e1c4..5805e68 100644
--- a/plasma/generic/applets/system-monitor/ram.cpp
+++ b/plasma/generic/applets/system-monitor/ram.cpp
@@ -200,17 +200,30 @@ void SM::Ram::createConfigurationInterface(KConfigDialog *parent)
     m_model.setHorizontalHeaderLabels(QStringList() << i18n("RAM"));
     QStandardItem *parentItem = m_model.invisibleRootItem();
     QRegExp rx("mem/(\\w+)/.*");
+    QString ramName;
 
     foreach (const QString& ram, m_memories) {
         if (rx.indexIn(ram) != -1) {
-            QStandardItem *item1 = new QStandardItem(rx.cap(1));
-            item1->setEditable(false);
-            item1->setCheckable(true);
-            item1->setData(ram);
+            ramName = rx.cap(1);
+
+            // 'ram' should be "physical" or "swap". I'm not aware of other values
+            // for it, but who knows. (see also addVisualization)
+            if (ramName == "physical") {
+                ramName = i18nc("noun, hardware, physical RAM/memory", "physical");
+            } else if (ramName == "swap") {
+                ramName = i18nc("noun, hardware, swap file/partition", "swap");
+            }
+
+            QStandardItem *ramItem = new QStandardItem(ramName);
+            ramItem->setEditable(false);
+            ramItem->setCheckable(true);
+            ramItem->setData(ram);
+
             if (sources().contains(ram)) {
-                item1->setCheckState(Qt::Checked);
+                ramItem->setCheckState(Qt::Checked);
             }
-            parentItem->appendRow(item1);
+
+            parentItem->appendRow(ramItem);
         }
     }
 
@@ -237,10 +250,15 @@ void SM::Ram::configAccepted()
         QStandardItem *item = parentItem->child(i, 0);
         if (item) {
             if (item->checkState() == Qt::Checked) {
+                // data() is the untranslated string
+                // for use with sources
                 appendSource(item->data().toString());
             }
         }
     }
+
+    // note we write and read non-translated
+    // version to config file.
     cg.writeEntry("memories", sources());
 
     double interval = ui.intervalSpinBox->value();
[prev in list] [next in list] [prev in thread] [next in thread] 

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