[cogl/cogl.windows.fixes: 2/4] cogl/cogl.c: Do not hardcode COGL_LOCALEDIR on Windows
- From: Chun-wei Fan <fanchunwei src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [cogl/cogl.windows.fixes: 2/4] cogl/cogl.c: Do not hardcode COGL_LOCALEDIR on Windows
- Date: Wed, 13 Feb 2019 10:06:08 +0000 (UTC)
commit e70738e481f72ade8729a5113e6f585c6e1e6b7b
Author: Chun-wei Fan <fanchunwei src gnome org>
Date: Mon Feb 11 17:37:52 2019 +0800
cogl/cogl.c: Do not hardcode COGL_LOCALEDIR on Windows
Instead, we construct it according to where the Cogl DLL is found, as it
is likely that the Cogl DLL will land in somewhere that is not the
initial $(PREFIX)\bin on Windows.
cogl/cogl.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
---
diff --git a/cogl/cogl.c b/cogl/cogl.c
index 577ae72f..a93a654d 100644
--- a/cogl/cogl.c
+++ b/cogl/cogl.c
@@ -758,8 +758,17 @@ _cogl_init (void)
if (initialized == FALSE)
{
#ifdef ENABLE_NLS
- bindtextdomain (GETTEXT_PACKAGE, COGL_LOCALEDIR);
+ char *localedir = NULL;
+#ifdef _WIN32
+ char *basedir = g_win32_get_package_installation_directory_of_module (NULL);
+ localedir = g_build_filename (basedir, "share", "locale", NULL);
+ g_free (basedir);
+#else
+ localedir = g_strdup (COGL_LOCALEDIR);
+#endif
+ bindtextdomain (GETTEXT_PACKAGE, localedir);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+ g_free (localedir);
#endif
#if defined(COGL_HAS_GTYPE_SUPPORT) && !GLIB_CHECK_VERSION (2, 36, 0)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]