[maemo-commits] [maemo-commits] r15192 - in projects/haf/trunk/hildon-plugins-settings: . src

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Tue Feb 19 13:18:38 EET 2008
Author: jobi
Date: 2008-02-19 13:18:36 +0200 (Tue, 19 Feb 2008)
New Revision: 15192

Modified:
   projects/haf/trunk/hildon-plugins-settings/ChangeLog
   projects/haf/trunk/hildon-plugins-settings/src/hildon-plugin-config-parser.c
Log:

2008-02-19  Johan Bilien  <johan.bilien at nokia.com>

	* src/hildon-plugin-config-parser.c:
	- add support for X-Text-Domain, so that the domain used for
	translating the applet name can be given in the desktop file.
	Fixes: NB#79321



Modified: projects/haf/trunk/hildon-plugins-settings/ChangeLog
===================================================================
--- projects/haf/trunk/hildon-plugins-settings/ChangeLog	2008-02-19 09:13:21 UTC (rev 15191)
+++ projects/haf/trunk/hildon-plugins-settings/ChangeLog	2008-02-19 11:18:36 UTC (rev 15192)
@@ -1,3 +1,10 @@
+2008-02-19  Johan Bilien  <johan.bilien at nokia.com>
+
+	* src/hildon-plugin-config-parser.c:
+	- add support for X-Text-Domain, so that the domain used for
+	translating the applet name can be given in the desktop file.
+	Fixes: NB#79321
+
 2007-10-03  Moises Martinez  <moises.martinez at nokia.com>
 
 	* src/hildon-plugin-config-parser.c:

Modified: projects/haf/trunk/hildon-plugins-settings/src/hildon-plugin-config-parser.c
===================================================================
--- projects/haf/trunk/hildon-plugins-settings/src/hildon-plugin-config-parser.c	2008-02-19 09:13:21 UTC (rev 15191)
+++ projects/haf/trunk/hildon-plugins-settings/src/hildon-plugin-config-parser.c	2008-02-19 11:18:36 UTC (rev 15192)
@@ -299,6 +299,7 @@
   GtkTreeIter iter;
   GList *l;
   gint *icon_sizes = NULL;
+  gchar *text_domain = NULL;
 
   if (!g_key_file_load_from_file 
         (keyfile,filename,G_KEY_FILE_NONE,&external_error))
@@ -326,6 +327,12 @@
 		       g_strdup (filename),
 		       data);
 
+  text_domain = g_key_file_get_string 
+                  (keyfile,
+                   HP_DESKTOP_GROUP,
+                   "X-Text-Domain",
+                   NULL); 
+
   for (l = parser->priv->keys; l != NULL; l = g_list_next (l))
   {
      gchar *_string = NULL;
@@ -356,7 +363,7 @@
            (GTK_LIST_STORE (parser->tm), &iter,
 	    hildon_plugin_config_parser_get_key_id 
 	      (parser,(const gchar *)l->data)+HP_PREDEFINED_COLS,
-	    dgettext(GETTEXT_PACKAGE, _string),
+	    dgettext(text_domain ? text_domain : GETTEXT_PACKAGE, _string),
 	    -1);
        }
        else
@@ -482,6 +489,8 @@
   }
 
   g_key_file_free (keyfile);
+
+  g_free (text_domain);
   
   return TRUE;
 }


More information about the maemo-commits mailing list