[amtk/meson-msvc: 9/18] amtk-init.c: Do not hardcode DATADIR on Windows
- From: Chun-wei Fan <fanchunwei src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [amtk/meson-msvc: 9/18] amtk-init.c: Do not hardcode DATADIR on Windows
- Date: Fri, 8 May 2020 07:47:50 +0000 (UTC)
commit 6f2a28f7c501c5dd1eb7009072abcc8e86e356f3
Author: Chun-wei Fan <fanchunwei src gnome org>
Date: Tue Apr 28 13:19:34 2020 +0800
amtk-init.c: Do not hardcode DATADIR on Windows
Instead, we construct the path to the translations directory on the fly via
g_win32_get_package_installation_directory_of_module()
amtk/amtk-init.c | 6 ++++++
1 file changed, 6 insertions(+)
---
diff --git a/amtk/amtk-init.c b/amtk/amtk-init.c
index 8c559a3..e9f39dc 100644
--- a/amtk/amtk-init.c
+++ b/amtk/amtk-init.c
@@ -41,7 +41,13 @@ amtk_init (void)
{
gchar *locale_dir;
+#ifdef G_OS_WIN32
+ gchar *basedir = g_win32_get_package_installation_directory_of_module (NULL);
+ locale_dir = g_build_filename (basedir, "share", "locale", NULL);
+ g_free (basedir);
+#else
locale_dir = g_build_filename (DATADIR, "locale", NULL);
+#endif
bindtextdomain (GETTEXT_PACKAGE, locale_dir);
g_free (locale_dir);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]