[Xfce4-commits] <parole:master> Set the locale before loading the GtkBuilder interface definition for the dialogs
Ali Abdallah
noreply at xfce.org
Wed Oct 21 12:16:05 CEST 2009
Updating branch refs/heads/master
to 80a358e16a7933529c70e5982bc7ad0774109580 (commit)
from 3c08ba38221985f92f6f228bcb28f481cdcae484 (commit)
commit 80a358e16a7933529c70e5982bc7ad0774109580
Author: Ali Abdallah <ali at ali-xfce.org>
Date: Wed Oct 21 12:15:51 2009 +0200
Set the locale before loading the GtkBuilder interface definition for the dialogs
parole/parole-builder.c | 31 +++++++++++--------------------
parole/parole-builder.h | 2 --
2 files changed, 11 insertions(+), 22 deletions(-)
diff --git a/parole/parole-builder.c b/parole/parole-builder.c
index 926144a..43179ea 100644
--- a/parole/parole-builder.c
+++ b/parole/parole-builder.c
@@ -26,6 +26,8 @@
#include <stdlib.h>
#include <string.h>
+#include <libxfce4util/libxfce4util.h>
+
#include "interfaces/parole_ui.h"
#include "parole-builder.h"
@@ -47,32 +49,21 @@ parole_builder_get_main_interface (void)
return GTK_BUILDER (parole_builder_object);
}
-GtkBuilder *parole_builder_new_from_file (const gchar *file)
-{
- GtkBuilder *builder;
- GError *error = NULL;
-
- builder = gtk_builder_new ();
-
- gtk_builder_add_from_file (GTK_BUILDER (builder),
- file,
- &error);
-
- if ( error )
- {
- g_critical ("%s", error->message);
- g_error_free (error);
- }
-
- return builder;
-}
-
GtkBuilder *parole_builder_new_from_string (const gchar *ui, gsize length)
{
GError *error = NULL;
GtkBuilder *builder;
builder = gtk_builder_new ();
+
+ /*
+ * Set the locale before loading the GtkBuilder interface definition
+ * probably this will be fixed in libxfce4util's side so keep a version
+ * check.
+ */
+#if LIBXFCE4UTIL_CHECK_VERSION (4, 6, 1)
+ xfce_textdomain (GETTEXT_PACKAGE, LOCALEDIR, "UTF-8");
+#endif
gtk_builder_add_from_string (builder, ui, length, &error);
diff --git a/parole/parole-builder.h b/parole/parole-builder.h
index 4411f22..3f0cbf0 100644
--- a/parole/parole-builder.h
+++ b/parole/parole-builder.h
@@ -28,8 +28,6 @@ G_BEGIN_DECLS
GtkBuilder *parole_builder_get_main_interface (void);
-GtkBuilder *parole_builder_new_from_file (const gchar *file);
-
GtkBuilder *parole_builder_new_from_string (const gchar *ui,
gsize length);
More information about the Xfce4-commits
mailing list