[glib/glib.fixtools.i18n: 51/53] glib-private.h: Set the appropriate string for setlocale()



commit 715d47a03d74e58b119f862399f15804abd3a779
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Wed Jun 5 16:34:57 2019 +0800

    glib-private.h: Set the appropriate string for setlocale()
    
    On Windows, in particular the CRTs on and after Visual Studio 2012, it
    is not enough just to do setlocale (LC_ALL, "") to set the default
    system locale, which results in the tools that use the translated
    messages to show unreadable messages when running the commmand line
    tools.
    
    This adds an entry in glib-private.h.in which denotes the appropriate
    string to use for setlocale() to set the default system locale by
    setting it to ".ACP" if we are building on Windows and "" for
    other systems (as we are doing now).
    
    The tools in gio/ will be updated in the next commit to make use of this
    entry so that the translated messages can be shown correctly.

 glib/glib-private.h | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/glib/glib-private.h b/glib/glib-private.h
index d0099236f..6fe67ab45 100644
--- a/glib/glib-private.h
+++ b/glib/glib-private.h
@@ -84,4 +84,10 @@ typedef struct {
 GLIB_AVAILABLE_IN_ALL
 GLibPrivateVTable *glib__private__ (void);
 
+#ifdef G_OS_WIN32
+# define GLIB_DEFAULT_LOCALE ".ACP"
+#else
+# define GLIB_DEFAULT_LOCALE ""
+#endif
+
 #endif /* __GLIB_PRIVATE_H__ */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]