[amtk/master.nmake: 4/5] 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/master.nmake: 4/5] amtk-init.c: Do not hardcode DATADIR on Windows
- Date: Tue, 28 Apr 2020 05:44:37 +0000 (UTC)
commit 2d6a607b9e59cc59c5404ac85bbd3c0ef8e37539
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]