summaryrefslogtreecommitdiff
path: root/libxfce4panel
diff options
context:
space:
mode:
authorNick Schermer <nick@xfce.org>2010-12-11 13:43:12 +0100
committerNick Schermer <nick@xfce.org>2010-12-11 13:43:36 +0100
commit0879ad66d690e7bb81206614cbf2aa1c352d859b (patch)
tree665c5a0c22350993588546524a4a2f1ba2763e00 /libxfce4panel
parentf593d16351743a9f8918d7c02ee279a15fa9a04c (diff)
Bind panel translation domain for external plugins (bug #6932).
Diffstat (limited to 'libxfce4panel')
-rw-r--r--libxfce4panel/Makefile.am1
-rw-r--r--libxfce4panel/xfce-panel-plugin.c14
2 files changed, 15 insertions, 0 deletions
diff --git a/libxfce4panel/Makefile.am b/libxfce4panel/Makefile.am
index 1a0fb7b7..29c3f8b4 100644
--- a/libxfce4panel/Makefile.am
+++ b/libxfce4panel/Makefile.am
@@ -3,6 +3,7 @@ INCLUDES = \
-I$(top_srcdir) \
-DG_LOG_DOMAIN=\"libxfce4panel\" \
-DLIBXFCE4PANEL_COMPILATION \
+ -DPACKAGE_LOCALE_DIR=\"$(localedir)\" \
$(PLATFORM_CPPFLAGS)
lib_LTLIBRARIES = \
diff --git a/libxfce4panel/xfce-panel-plugin.c b/libxfce4panel/xfce-panel-plugin.c
index 4c9323c3..e0b039f7 100644
--- a/libxfce4panel/xfce-panel-plugin.c
+++ b/libxfce4panel/xfce-panel-plugin.c
@@ -20,6 +20,13 @@
#include <config.h>
#endif
+#ifdef HAVE_LIBINTL_H
+#include <libintl.h>
+#endif
+#ifdef HAVE_LOCALE_H
+#include <locale.h>
+#endif
+
#include <gtk/gtk.h>
#include <glib.h>
#include <libxfce4util/libxfce4util.h>
@@ -583,6 +590,13 @@ xfce_panel_plugin_init (XfcePanelPlugin *plugin)
plugin->priv->locked = TRUE;
plugin->priv->menu_items = NULL;
+ /* bind the text domain of the panel so our strings
+ * are properly translated in the old 4.6 panel plugins */
+ bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR);
+#ifdef HAVE_BIND_TEXTDOMAIN_CODESET
+ bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+#endif
+
/* hide the event box window to make the plugin transparent */
gtk_event_box_set_visible_window (GTK_EVENT_BOX (plugin), FALSE);
}