[gnome-multi-writer] Add a translatable version of a generic flash drive



commit e0d5feb90790b49f4ae2d1c49f3f0fcaad65d5ef
Author: Richard Hughes <richard hughsie com>
Date:   Sun Jan 11 13:33:39 2015 +0000

    Add a translatable version of a generic flash drive

 src/gmw-device.c |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/src/gmw-device.c b/src/gmw-device.c
index db95f76..863c05c 100644
--- a/src/gmw-device.c
+++ b/src/gmw-device.c
@@ -377,7 +377,26 @@ void
 gmw_device_set_name (GmwDevice *device, const gchar *name)
 {
        GmwDevicePrivate *priv = gmw_device_get_instance_private (device);
+       guint i;
+       struct {
+               const gchar *old;
+               const gchar *new;
+       } replace[] = {
+               /* TRANSLATORS: This is a generic no-name USB flash disk */
+               { "General UDisk", _("USB Flash Drive") },
+               { NULL, NULL }
+       };
+
        g_return_if_fail (GMW_IS_DEVICE (device));
+
+       /* replace any generic names */
+       for (i = 0; replace[i].old != NULL; i++) {
+               if (g_strcmp0 (replace[i].old, name) == 0) {
+                       name = replace[i].new;
+                       break;
+               }
+       }
+
        g_mutex_lock (&priv->mutex);
        g_free (priv->name);
        priv->name = g_strdup (name);


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