diff --git a/src/fe-gtk/fe-gtk.c b/src/fe-gtk/fe-gtk.c index 9c48a44d..7e40717f 100644 --- a/src/fe-gtk/fe-gtk.c +++ b/src/fe-gtk/fe-gtk.c @@ -29,6 +29,7 @@ #ifdef WIN32 #include #include +#include #else #include #endif @@ -301,9 +302,28 @@ fe_args (int argc, char *argv[]) GOptionContext *context; char *buffer; const char *desktop_id = "net.zoite.Zoitechat"; +#ifdef WIN32 + char *base_path = NULL; + char *locale_path = NULL; +#endif #ifdef ENABLE_NLS +#ifdef WIN32 + base_path = g_win32_get_package_installation_directory_of_module (NULL); + if (base_path) + { + locale_path = g_build_filename (base_path, "share", "locale", NULL); + bindtextdomain (GETTEXT_PACKAGE, locale_path); + } + else + { + bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR); + } + g_free (locale_path); + g_free (base_path); +#else bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR); +#endif bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); textdomain (GETTEXT_PACKAGE); #endif diff --git a/src/fe-text/fe-text.c b/src/fe-text/fe-text.c index e73bd585..9e68a333 100644 --- a/src/fe-text/fe-text.c +++ b/src/fe-text/fe-text.c @@ -26,6 +26,7 @@ #endif #ifdef WIN32 #include +#include #define STDIN_FILENO 0 #define STDOUT_FILENO 1 #else @@ -478,9 +479,28 @@ fe_args (int argc, char *argv[]) { GError *error = NULL; GOptionContext *context; +#ifdef WIN32 + char *base_path = NULL; + char *locale_path = NULL; +#endif #ifdef ENABLE_NLS +#ifdef WIN32 + base_path = g_win32_get_package_installation_directory_of_module (NULL); + if (base_path) + { + locale_path = g_build_filename (base_path, "share", "locale", NULL); + bindtextdomain (GETTEXT_PACKAGE, locale_path); + } + else + { + bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR); + } + g_free (locale_path); + g_free (base_path); +#else bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR); +#endif bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); textdomain (GETTEXT_PACKAGE); #endif