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

List:       kde-i18n-doc
Subject:    =?utf-8?q?=5Bkde-workspace/KDE/4=2E6=5D_powerdevil/daemon=3A_fix?=
From:       Frederik Schwarzer <schwarzerf () gmail ! com>
Date:       2011-01-31 21:03:46
Message-ID: 20110131210346.981FFA6094 () git ! kde ! org
[Download RAW message or body]

Git commit 5fe9fde09b57c64faf7ca6da768f6afaf9b89318 by Frederik Schwarzer.
Pushed by schwarzer into branch 'KDE/4.6'.

fix plural handling

CCMAIL: kde-i18n-doc@kde.org

M  +31   -19   powerdevil/daemon/powerdevilcore.cpp     

http://commits.kde.org/a5d5b61a/5fe9fde09b57c64faf7ca6da768f6afaf9b89318

diff --git a/powerdevil/daemon/powerdevilcore.cpp \
b/powerdevil/daemon/powerdevilcore.cpp index cde9383..3d08b02 100644
--- a/powerdevil/daemon/powerdevilcore.cpp
+++ b/powerdevil/daemon/powerdevilcore.cpp
@@ -192,31 +192,43 @@ void Core::checkBatteryStatus()
          i != m_backend->capacities().constEnd(); ++i) {
         if (i.value() < 50) {
             // Notify, we have a broken battery.
-            emitNotification("brokenbattery", i18np("Your battery capacity is %2%. \
                This means your battery is broken "
-                                                    "and needs a replacement. Please \
                contact your hardware vendor for more details.",
-
-                                                    "One of your batteries (ID %3) \
                has a capacity of %2%. This means it is broken "
-                                                    "and needs a replacement. Please \
                contact your hardware vendor for more details.",
-                                                    m_loadedBatteriesUdi.size(), \
                i.value(), i.key()),
-                             "dialog-warning");
+            if (m_loadedBatteriesUdi.size() == 1) {
+                emitNotification("brokenbattery",
+                                 i18n("Your battery capacity is %1%. This means your \
battery is broken and " +                                      "needs a replacement. \
Please contact your hardware vendor for more details.", +                             \
i.value()), +                                 "dialog-warning");
+            } else {
+                emitNotification("brokenbattery",
+                                 i18n("One of your batteries (ID %2) has a capacity \
of %1%. This means it is broken " +                                      "and needs a \
replacement. Please contact your hardware vendor for more details.", +                \
i.value(), i.key()), +                                 "dialog-warning");
+            }
         }
     }
 
     // Any recalled batteries?
     foreach (const BackendInterface::RecallNotice &notice, \
m_backend->recallNotices()) {  // Notify, a battery has been recalled
-        emitNotification("brokenbattery", i18np("Your battery might have been \
                recalled by %2. Usually, when vendors recall the "
-                                                "hardware, it is because of factory \
                defects which are usually eligible for a "
-                                                "free repair or substitution. Please \
                check <a href=\"%3\">%2's website</a> to "
-                                                "verify if your battery is \
                faulted.",
-
-                                                "One of your batteries (ID %4) might \
                have been recalled by %2. "
-                                                "Usually, when vendors recall the \
                hardware, it is because of factory defects "
-                                                "which are usually eligible for a \
                free repair or substitution. "
-                                                "Please check <a href=\"%3\">%2's \
                website</a> to "
-                                                "verify if your battery is \
                faulted.",
-                                                m_loadedBatteriesUdi.size(), \
                notice.vendor, notice.url, notice.batteryId),
-                         "dialog-warning");
+        if (m_loadedBatteriesUdi.size() == 1) {
+            emitNotification("brokenbattery",
+                             i18n("Your battery might have been recalled by %1. \
Usually, when vendors recall the " +                                  "hardware, it \
is because of factory defects which are usually eligible for a " +                    \
"free repair or substitution. Please check <a href=\"%2\">%1's website</a> to " +     \
"verify if your battery is faulted.", +                                  \
notice.vendor, notice.url), +                             "dialog-warning");
+        } else {
+            emitNotification("brokenbattery",
+                             i18n("One of your batteries (ID %3) might have been \
recalled by %1. " +                                  "Usually, when vendors recall \
the hardware, it is because of factory defects " +                                  \
"which are usually eligible for a free repair or substitution. " +                    \
"Please check <a href=\"%2\">%1's website</a> to " +                                  \
"verify if your battery is faulted.", +                                  \
notice.vendor, notice.url, notice.batteryId), +                             \
"dialog-warning"); +        }
     }
 }
 


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

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