r16198 - gnucash/trunk - Do not call setlocale &friends from within the file backend library.

Andreas Köhler andi5 at cvs.gnucash.org
Fri Jun 22 09:31:20 EDT 2007


Author: andi5
Date: 2007-06-22 09:31:18 -0400 (Fri, 22 Jun 2007)
New Revision: 16198
Trac: http://svn.gnucash.org/trac/changeset/16198

Modified:
   gnucash/trunk/lib/libqof/backend/file/qof-backend-qsf.h
   gnucash/trunk/src/backend/file/gnc-backend-file.c
Log:
Do not call setlocale &friends from within the file backend library.

The only valid call would be to bindtextdomain, but the library does not
use a different locale directory anyway.


Modified: gnucash/trunk/lib/libqof/backend/file/qof-backend-qsf.h
===================================================================
--- gnucash/trunk/lib/libqof/backend/file/qof-backend-qsf.h	2007-06-22 07:26:35 UTC (rev 16197)
+++ gnucash/trunk/lib/libqof/backend/file/qof-backend-qsf.h	2007-06-22 13:31:18 UTC (rev 16198)
@@ -158,9 +158,6 @@
 Initialises the backend and provides access to the
 functions that will load and save the data. Initialises
 default values for the QofBackendOption KvpFrame.
-
-Calls gettext because QofBackendOption
-strings are translatable.
 */
 G_MODULE_EXPORT const gchar *
 g_module_check_init(GModule *module);

Modified: gnucash/trunk/src/backend/file/gnc-backend-file.c
===================================================================
--- gnucash/trunk/src/backend/file/gnc-backend-file.c	2007-06-22 07:26:35 UTC (rev 16197)
+++ gnucash/trunk/src/backend/file/gnc-backend-file.c	2007-06-22 13:31:18 UTC (rev 16198)
@@ -53,7 +53,6 @@
 #include "gnc-engine.h"
 
 #include "gnc-filepath-utils.h"
-#include "gnc-path.h"
 
 #include "io-gncxml.h"
 #include "io-gncxml-v2.h"
@@ -1061,19 +1060,7 @@
 G_MODULE_EXPORT const gchar *
 g_module_check_init(GModule *module)
 {
-	QofBackendProvider *prov;
-#ifdef ENABLE_NLS
-	gchar *localedir = gnc_path_get_localedir ();
-	/* FIXME: It is unclear whether setlocale() is actually
-	   needed here (added in r11313). Some platforms might
-	   need it so that gettext works correctly in this
-	   GModule. We'll keep it for now. */
-	setlocale (LC_ALL, "");
-	bindtextdomain (GETTEXT_PACKAGE, localedir);
-	bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
-	textdomain (GETTEXT_PACKAGE);
-	g_free (localedir);
-#endif
+        QofBackendProvider *prov;
         prov = g_new0 (QofBackendProvider, 1);
         prov->provider_name = "GnuCash File Backend Version 2";
         prov->access_method = "file";



More information about the gnucash-changes mailing list