aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-09-02 21:37:25 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-09-02 21:37:25 +0800
commit88a455a446bdf3617de594052dc5c756c1013da8 (patch)
treee4b670855f606a9a8b266e50d2941dbd65e556a4 /libempathy-gtk
parent1446a4070254cb7cb02fa79dabf724e0429a7ca5 (diff)
parent5091e14d27d15b56fccf46d6a26b142b2223872a (diff)
downloadgsoc2013-empathy-88a455a446bdf3617de594052dc5c756c1013da8.tar
gsoc2013-empathy-88a455a446bdf3617de594052dc5c756c1013da8.tar.gz
gsoc2013-empathy-88a455a446bdf3617de594052dc5c756c1013da8.tar.bz2
gsoc2013-empathy-88a455a446bdf3617de594052dc5c756c1013da8.tar.lz
gsoc2013-empathy-88a455a446bdf3617de594052dc5c756c1013da8.tar.xz
gsoc2013-empathy-88a455a446bdf3617de594052dc5c756c1013da8.tar.zst
gsoc2013-empathy-88a455a446bdf3617de594052dc5c756c1013da8.zip
Merge branch 'translate-param-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 a5c3e8dc4..49c1ca174 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);