From 70d0c31b85c0697fca910e30bd132c3ec22b0013 Mon Sep 17 00:00:00 2001
From: Benedikt Meurer <benny@xfce.org>
Date: Sun, 30 Apr 2006 21:52:34 +0000
Subject: [PATCH] 2006-04-30	Benedikt Meurer <benny@xfce.org>

	* plugins/thunar-apr/thunar-apr-desktop-page.c: Use g_access() on Win32.
	* plugins/thunar-apr/thunar-apr-private.{c,h},
	  plugins/thunar-apr/thunar-apr-abstract-page.c,
	  plugins/thunar-apr/Makefile.am: Properly initialize the i18n support
	  for the Advanced Properties plugin.
	* plugins/thunar-uca/thunar-uca-private.{c,h},
	  plugins/thunar-uca/thunar-uca-provider.c,
	  plugins/thunar-uca/Makefile.am: Properly initialize the i18n support
	  for the User Customizable Actions plugin.




(Old svn revision: 21409)
---
 ChangeLog                                     | 12 +++++
 plugins/thunar-apr/Makefile.am                |  3 ++
 plugins/thunar-apr/thunar-apr-abstract-page.c |  3 ++
 plugins/thunar-apr/thunar-apr-desktop-page.c  |  4 +-
 plugins/thunar-apr/thunar-apr-private.c       | 53 +++++++++++++++++++
 plugins/thunar-apr/thunar-apr-private.h       | 32 +++++++++++
 plugins/thunar-uca/Makefile.am                |  3 ++
 plugins/thunar-uca/thunar-uca-private.c       | 53 +++++++++++++++++++
 plugins/thunar-uca/thunar-uca-private.h       | 32 +++++++++++
 plugins/thunar-uca/thunar-uca-provider.c      |  4 ++
 10 files changed, 197 insertions(+), 2 deletions(-)
 create mode 100644 plugins/thunar-apr/thunar-apr-private.c
 create mode 100644 plugins/thunar-apr/thunar-apr-private.h
 create mode 100644 plugins/thunar-uca/thunar-uca-private.c
 create mode 100644 plugins/thunar-uca/thunar-uca-private.h

diff --git a/ChangeLog b/ChangeLog
index b5fab320b..a0255b974 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2006-04-30	Benedikt Meurer <benny@xfce.org>
+
+	* plugins/thunar-apr/thunar-apr-desktop-page.c: Use g_access() on Win32.
+	* plugins/thunar-apr/thunar-apr-private.{c,h},
+	  plugins/thunar-apr/thunar-apr-abstract-page.c,
+	  plugins/thunar-apr/Makefile.am: Properly initialize the i18n support
+	  for the Advanced Properties plugin.
+	* plugins/thunar-uca/thunar-uca-private.{c,h},
+	  plugins/thunar-uca/thunar-uca-provider.c,
+	  plugins/thunar-uca/Makefile.am: Properly initialize the i18n support
+	  for the User Customizable Actions plugin.
+
 2006-04-26	Benedikt Meurer <benny@xfce.org>
 
 	* thunar/thunar-folder.c: No need to reset the folder in the dispose()
diff --git a/plugins/thunar-apr/Makefile.am b/plugins/thunar-apr/Makefile.am
index 5150f1680..e42dc1879 100644
--- a/plugins/thunar-apr/Makefile.am
+++ b/plugins/thunar-apr/Makefile.am
@@ -7,6 +7,7 @@ INCLUDES =								\
 	-I$(top_srcdir)/plugins						\
 	-DEXO_API_SUBJECT_TO_CHANGE					\
 	-DG_LOG_DOMAIN=\"thunar-apr\"					\
+	-DPACKAGE_LOCALE_DIR=\"$(localedir)\"				\
 	$(PLATFORM_CPPFLAGS)
 
 extensionsdir = $(libdir)/thunarx-$(THUNAR_VERSION_API)
@@ -21,6 +22,8 @@ thunar_apr_la_SOURCES =							\
 	thunar-apr-image-page.c						\
 	thunar-apr-image-page.h						\
 	thunar-apr-plugin.c						\
+	thunar-apr-private.c						\
+	thunar-apr-private.h						\
 	thunar-apr-provider.c						\
 	thunar-apr-provider.h
 
diff --git a/plugins/thunar-apr/thunar-apr-abstract-page.c b/plugins/thunar-apr/thunar-apr-abstract-page.c
index 49922038e..1766c36ec 100644
--- a/plugins/thunar-apr/thunar-apr-abstract-page.c
+++ b/plugins/thunar-apr/thunar-apr-abstract-page.c
@@ -23,6 +23,7 @@
 #endif
 
 #include <thunar-apr/thunar-apr-abstract-page.h>
+#include <thunar-apr/thunar-apr-private.h>
 
 
 
@@ -114,6 +115,8 @@ thunar_apr_abstract_page_class_init (ThunarAprAbstractPageClass *klass)
 static void
 thunar_apr_abstract_page_init (ThunarAprAbstractPage *abstract_page)
 {
+  /* be sure to setup the i18n support for the thunar-apr plugin */
+  thunar_apr_i18n_init ();
 }
 
 
diff --git a/plugins/thunar-apr/thunar-apr-desktop-page.c b/plugins/thunar-apr/thunar-apr-desktop-page.c
index 3e0ab58f5..95f696d71 100644
--- a/plugins/thunar-apr/thunar-apr-desktop-page.c
+++ b/plugins/thunar-apr/thunar-apr-desktop-page.c
@@ -40,8 +40,8 @@
 
 #include <thunar-apr/thunar-apr-desktop-page.h>
 
-/* use g_access() if available */
-#if GLIB_CHECK_VERSION(2,8,0)
+/* use g_access() on win32 */
+#if GLIB_CHECK_VERSION(2,8,0) && defined(G_OS_WIN32)
 #include <glib/gstdio.h>
 #else
 #define g_access(filename, mode) (access ((filename), (mode)))
diff --git a/plugins/thunar-apr/thunar-apr-private.c b/plugins/thunar-apr/thunar-apr-private.c
new file mode 100644
index 000000000..756bac13a
--- /dev/null
+++ b/plugins/thunar-apr/thunar-apr-private.c
@@ -0,0 +1,53 @@
+/* $Id$ */
+/*-
+ * Copyright (c) 2006 Benedikt Meurer <benny@xfce.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#ifdef HAVE_LIBINTL_H
+#include <libintl.h>
+#endif
+#ifdef HAVE_LOCALE_H
+#include <locale.h>
+#endif
+
+#include <thunar-apr/thunar-apr-private.h>
+
+#include <exo/exo.h>
+
+
+
+/**
+ * thunar_apr_i18n_init:
+ *
+ * Sets up i18n support for the thunar-apr plugin.
+ **/
+void
+thunar_apr_i18n_init (void)
+{
+  bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR);
+#ifdef HAVE_BIND_TEXTDOMAIN_CODESET
+  bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+#endif
+}
+
+
+
diff --git a/plugins/thunar-apr/thunar-apr-private.h b/plugins/thunar-apr/thunar-apr-private.h
new file mode 100644
index 000000000..1dff79f87
--- /dev/null
+++ b/plugins/thunar-apr/thunar-apr-private.h
@@ -0,0 +1,32 @@
+/* $Id$ */
+/*-
+ * Copyright (c) 2006 Benedikt Meurer <benny@xfce.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __THUNAR_APR_PRIVATE_H__
+#define __THUNAR_APR_PRIVATE_H__
+
+#include <glib.h>
+
+G_BEGIN_DECLS;
+
+void thunar_apr_i18n_init (void) G_GNUC_INTERNAL;
+
+G_END_DECLS;
+
+#endif /* !__THUNAR_APR_PRIVATE_H__ */
diff --git a/plugins/thunar-uca/Makefile.am b/plugins/thunar-uca/Makefile.am
index 3f818a542..a4b64b298 100644
--- a/plugins/thunar-uca/Makefile.am
+++ b/plugins/thunar-uca/Makefile.am
@@ -9,6 +9,7 @@ INCLUDES =								\
 	-DDATADIR=\"$(datadir)\"					\
 	-DEXO_API_SUBJECT_TO_CHANGE					\
 	-DG_LOG_DOMAIN=\"thunar-uca\"					\
+	-DPACKAGE_LOCALE_DIR=\"$(localedir)\"				\
 	$(PLATFORM_CPPFLAGS)
 
 extensionsdir = $(libdir)/thunarx-$(THUNAR_VERSION_API)
@@ -25,6 +26,8 @@ thunar_uca_la_SOURCES =							\
 	thunar-uca-model.c						\
 	thunar-uca-model.h						\
 	thunar-uca-plugin.c						\
+	thunar-uca-private.c						\
+	thunar-uca-private.h						\
 	thunar-uca-provider.c						\
 	thunar-uca-provider.h
 
diff --git a/plugins/thunar-uca/thunar-uca-private.c b/plugins/thunar-uca/thunar-uca-private.c
new file mode 100644
index 000000000..89d1ad5aa
--- /dev/null
+++ b/plugins/thunar-uca/thunar-uca-private.c
@@ -0,0 +1,53 @@
+/* $Id$ */
+/*-
+ * Copyright (c) 2006 Benedikt Meurer <benny@xfce.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#ifdef HAVE_LIBINTL_H
+#include <libintl.h>
+#endif
+#ifdef HAVE_LOCALE_H
+#include <locale.h>
+#endif
+
+#include <thunar-uca/thunar-uca-private.h>
+
+#include <exo/exo.h>
+
+
+
+/**
+ * thunar_uca_i18n_init:
+ *
+ * Sets up i18n support for the thunar-uca plugin.
+ **/
+void
+thunar_uca_i18n_init (void)
+{
+  bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR);
+#ifdef HAVE_BIND_TEXTDOMAIN_CODESET
+  bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+#endif
+}
+
+
+
diff --git a/plugins/thunar-uca/thunar-uca-private.h b/plugins/thunar-uca/thunar-uca-private.h
new file mode 100644
index 000000000..a865754dd
--- /dev/null
+++ b/plugins/thunar-uca/thunar-uca-private.h
@@ -0,0 +1,32 @@
+/* $Id$ */
+/*-
+ * Copyright (c) 2006 Benedikt Meurer <benny@xfce.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __THUNAR_UCA_PRIVATE_H__
+#define __THUNAR_UCA_PRIVATE_H__
+
+#include <glib.h>
+
+G_BEGIN_DECLS;
+
+void thunar_uca_i18n_init (void) G_GNUC_INTERNAL;
+
+G_END_DECLS;
+
+#endif /* !__THUNAR_UCA_PRIVATE_H__ */
diff --git a/plugins/thunar-uca/thunar-uca-provider.c b/plugins/thunar-uca/thunar-uca-provider.c
index 85983b95a..1e6e11910 100644
--- a/plugins/thunar-uca/thunar-uca-provider.c
+++ b/plugins/thunar-uca/thunar-uca-provider.c
@@ -27,6 +27,7 @@
 #include <thunar-uca/thunar-uca-chooser.h>
 #include <thunar-uca/thunar-uca-context.h>
 #include <thunar-uca/thunar-uca-model.h>
+#include <thunar-uca/thunar-uca-private.h>
 #include <thunar-uca/thunar-uca-provider.h>
 
 
@@ -127,6 +128,9 @@ thunar_uca_provider_preferences_provider_init (ThunarxPreferencesProviderIface *
 static void
 thunar_uca_provider_init (ThunarUcaProvider *uca_provider)
 {
+  /* setup the i18n support first */
+  thunar_uca_i18n_init ();
+
   /* grab a reference on the default model */
   uca_provider->model = thunar_uca_model_get_default ();
 
-- 
GitLab