aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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);