aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-09-02 19:04:13 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-09-02 19:23:22 +0800
commit5091e14d27d15b56fccf46d6a26b142b2223872a (patch)
treea813dc91dbb892c2dc0b4194d30ed7072c73554e /libempathy-gtk
parentba5f02669144bd3e9728ddf85f1ea8fcd3994332 (diff)
downloadgsoc2013-empathy-5091e14d27d15b56fccf46d6a26b142b2223872a.tar
gsoc2013-empathy-5091e14d27d15b56fccf46d6a26b142b2223872a.tar.gz
gsoc2013-empathy-5091e14d27d15b56fccf46d6a26b142b2223872a.tar.bz2
gsoc2013-empathy-5091e14d27d15b56fccf46d6a26b142b2223872a.tar.lz
gsoc2013-empathy-5091e14d27d15b56fccf46d6a26b142b2223872a.tar.xz
gsoc2013-empathy-5091e14d27d15b56fccf46d6a26b142b2223872a.tar.zst
gsoc2013-empathy-5091e14d27d15b56fccf46d6a26b142b2223872a.zip
account_widget_generic_format_param_name: translate common params (#628601)
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-account-widget.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/libempathy-gtk/empathy-account-widget.c b/libempathy-gtk/empathy-account-widget.c
index d3cf1f3e4..95874fec6 100644
--- a/libempathy-gtk/empathy-account-widget.c
+++ b/libempathy-gtk/empathy-account-widget.c
@@ -491,11 +491,34 @@ empathy_account_widget_setup_widget (EmpathyAccountWidget *self,
}
}
+static GHashTable *
+build_translated_params (void)
+{
+ GHashTable *hash;
+
+ hash = g_hash_table_new (g_str_hash, g_str_equal);
+ g_hash_table_insert (hash, "account", _("Account"));
+ g_hash_table_insert (hash, "password", _("Password"));
+ g_hash_table_insert (hash, "server", _("Server"));
+ g_hash_table_insert (hash, "port", _("Port"));
+
+ return hash;
+}
+
static gchar *
account_widget_generic_format_param_name (const gchar *param_name)
{
gchar *str;
gchar *p;
+ static GHashTable *translated_params = NULL;
+
+ if (G_UNLIKELY (translated_params == NULL))
+ translated_params = build_translated_params ();
+
+ /* Translate most common parameters */
+ str = g_hash_table_lookup (translated_params, param_name);
+ if (str != NULL)
+ return g_strdup (str);
str = g_strdup (param_name);