From e0d5feb90790b49f4ae2d1c49f3f0fcaad65d5ef Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Sun, 11 Jan 2015 13:33:39 +0000 Subject: [PATCH] Add a translatable version of a generic flash drive --- src/gmw-device.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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);