[gnome-settings-daemon/gnome-3-4] power: Avoid duplicate translations



commit ebb0a8e4130ec20d1d5bb11ac85c1652e64e5c2f
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Jun 14 00:21:15 2012 -0400

    power: Avoid duplicate translations
    
    It confuses our tools if we have the same msgid both in
    gettext() and ngettext(), so be a bit more clever here.
    Bonus: save 40 lines of code.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=669732

 plugins/power/gpm-common.c |   43 ++-----------------------------------------
 1 files changed, 2 insertions(+), 41 deletions(-)
---
diff --git a/plugins/power/gpm-common.c b/plugins/power/gpm-common.c
index c0f42ff..5e4b3ae 100644
--- a/plugins/power/gpm-common.c
+++ b/plugins/power/gpm-common.c
@@ -751,12 +751,6 @@ gpm_device_to_localised_string (UpDevice *device)
                       "state", &state,
                       NULL);
 
-        /* line power */
-        if (kind == UP_DEVICE_KIND_LINE_POWER) {
-                /* TRANSLATORS: system power cord */
-                return _("AC adapter");
-        }
-
         /* laptop battery */
         if (kind == UP_DEVICE_KIND_BATTERY) {
 
@@ -788,9 +782,6 @@ gpm_device_to_localised_string (UpDevice *device)
                         /* TRANSLATORS: battery state */
                         return _("Laptop battery is waiting to discharge");
                 }
-
-                /* TRANSLATORS: laptop primary battery */
-                return _("Laptop battery");
         }
 
         /* UPS */
@@ -812,16 +803,6 @@ gpm_device_to_localised_string (UpDevice *device)
                         /* TRANSLATORS: battery state */
                         return _("UPS is charged");
                 }
-
-                /* TRANSLATORS: battery-backed AC power source */
-                return _("UPS");
-        }
-
-        /* monitor */
-        if (kind == UP_DEVICE_KIND_MONITOR) {
-
-                /* TRANSLATORS: a monitor is a device to measure voltage and current */
-                return _("Monitor");
         }
 
         /* mouse */
@@ -843,9 +824,6 @@ gpm_device_to_localised_string (UpDevice *device)
                         /* TRANSLATORS: battery state */
                         return _("Mouse is charged");
                 }
-
-                /* TRANSLATORS: wireless mice with internal batteries */
-                return _("Mouse");
         }
 
         /* keyboard */
@@ -867,9 +845,6 @@ gpm_device_to_localised_string (UpDevice *device)
                         /* TRANSLATORS: battery state */
                         return _("Keyboard is charged");
                 }
-
-                /* TRANSLATORS: wireless keyboard with internal battery */
-                return _("Keyboard");
         }
 
         /* PDA */
@@ -891,9 +866,6 @@ gpm_device_to_localised_string (UpDevice *device)
                         /* TRANSLATORS: battery state */
                         return _("PDA is charged");
                 }
-
-                /* TRANSLATORS: portable device */
-                return _("PDA");
         }
 
         /* phone */
@@ -915,9 +887,6 @@ gpm_device_to_localised_string (UpDevice *device)
                         /* TRANSLATORS: battery state */
                         return _("Cell phone is charged");
                 }
-
-                /* TRANSLATORS: cell phone (mobile...) */
-                return _("Cell phone");
         }
 #if UP_CHECK_VERSION(0,9,5)
 
@@ -940,9 +909,6 @@ gpm_device_to_localised_string (UpDevice *device)
                         /* TRANSLATORS: battery state */
                         return _("Media player is charged");
                 }
-
-                /* TRANSLATORS: media player, mp3 etc */
-                return _("Media player");
         }
 
         /* tablet */
@@ -964,9 +930,6 @@ gpm_device_to_localised_string (UpDevice *device)
                         /* TRANSLATORS: battery state */
                         return _("Tablet is charged");
                 }
-
-                /* TRANSLATORS: tablet device */
-                return _("Tablet");
         }
 
         /* computer */
@@ -988,10 +951,8 @@ gpm_device_to_localised_string (UpDevice *device)
                         /* TRANSLATORS: battery state */
                         return _("Computer is charged");
                 }
-
-                /* TRANSLATORS: tablet device */
-                return _("Computer");
         }
 #endif
-        return NULL;
+
+        return gpm_device_kind_to_localised_string (kind, 1);
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]