[empathy: 1/2] account_widget_generic_format_param_name: translate common params (#628601)
- From: Guillaume Desmottes <gdesmott src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [empathy: 1/2] account_widget_generic_format_param_name: translate common params (#628601)
- Date: Thu, 2 Sep 2010 13:37:39 +0000 (UTC)
commit 5091e14d27d15b56fccf46d6a26b142b2223872a
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date: Thu Sep 2 13:04:13 2010 +0200
account_widget_generic_format_param_name: translate common params (#628601)
libempathy-gtk/empathy-account-widget.c | 23 +++++++++++++++++++++++
1 files changed, 23 insertions(+), 0 deletions(-)
---
diff --git a/libempathy-gtk/empathy-account-widget.c b/libempathy-gtk/empathy-account-widget.c
index d3cf1f3..95874fe 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]