Use either lib/locale or share/locale depending on which one is in

2007-11-27  Tor Lillqvist  <tml@novell.com>

	* glib/gutils.c (_glib_get_locale_dir) [Win32]: Use either
	lib/locale or share/locale depending on which one is in
	GLIB_LOCALE_DIR. When the configury recognizes GNU gettext (based
	on the _nl_msg_cat_cntr variable, eek), share/locale gets used.

	* glib-zip.in: Likewise, look for message catalogs either in
	lib/locale or share/locale.


svn path=/trunk/; revision=5944
This commit is contained in:
Tor Lillqvist 2007-11-26 22:32:12 +00:00 committed by Tor Lillqvist
parent 13195ef836
commit 007d3ad28a
3 changed files with 43 additions and 16 deletions

View File

@ -1,3 +1,13 @@
2007-11-27 Tor Lillqvist <tml@novell.com>
* glib/gutils.c (_glib_get_locale_dir) [Win32]: Use either
lib/locale or share/locale depending on which one is in
GLIB_LOCALE_DIR. When the configury recognizes GNU gettext (based
on the _nl_msg_cat_cntr variable, eek), share/locale gets used.
* glib-zip.in: Likewise, look for message catalogs either in
lib/locale or share/locale.
2007-11-26 Matthias Clasen <mclasen@redhat.com>
* gio/gfileattribute.c: Fix up a doc comment.

View File

@ -16,7 +16,6 @@ cp -p @abs_srcdir@/COPYING share/doc/glib-dev-@GLIB_VERSION@
rm $ZIP
zip $ZIP -@ <<EOF
COPYING.LIB-2
bin/gspawn-win32-helper.exe
bin/gspawn-win32-helper-console.exe
bin/libglib-2.0-@LT_CURRENT_MINUS_AGE@.dll
@ -25,7 +24,17 @@ bin/libgobject-2.0-@LT_CURRENT_MINUS_AGE@.dll
bin/libgthread-2.0-@LT_CURRENT_MINUS_AGE@.dll
EOF
zip -r $ZIP lib/locale/*/LC_MESSAGES/glib20.mo
if [ -f lib/locale/de/LC_MESSAGES/glib20.mo -a -f share/locale/de/LC_MESSAGES/glib20.mo ]; then
if [ lib/locale/de/LC_MESSAGES/glib20.mo -nt share/locale/de/LC_MESSAGES/glib20.mo ]; then
zip -r $ZIP lib/locale/*/LC_MESSAGES/glib20.mo
else
zip -r $ZIP share/locale/*/LC_MESSAGES/glib20.mo
fi
elif [ -f lib/locale/de/LC_MESSAGES/glib20.mo ]; then
zip -r $ZIP lib/locale/*/LC_MESSAGES/glib20.mo
else
zip -r $ZIP share/locale/*/LC_MESSAGES/glib20.mo
fi
zip -r $ZIP share/doc/glib-@GLIB_VERSION@

View File

@ -3136,29 +3136,37 @@ _g_utils_thread_init (void)
/**
* _glib_get_locale_dir:
*
* Return the path to the lib\locale subfolder of the GLib
* installation folder. The path is in the system codepage. We have to
* use system codepage as bindtextdomain() doesn't have a UTF-8
* interface.
* Return the path to the share\locale or lib\locale subfolder of the
* GLib installation folder. The path is in the system codepage. We
* have to use system codepage as bindtextdomain() doesn't have a
* UTF-8 interface.
*/
static gchar *
_glib_get_locale_dir (void)
{
gchar *dir, *cp_dir;
gchar *install_dir, *locale_dir;
gchar *retval = NULL;
dir = g_win32_get_package_installation_directory (GETTEXT_PACKAGE, dll_name);
cp_dir = g_win32_locale_filename_from_utf8 (dir);
g_free (dir);
install_dir = g_win32_get_package_installation_directory (GETTEXT_PACKAGE, dll_name);
if (cp_dir)
if (install_dir)
{
/* Don't use g_build_filename() on pathnames in the system
* codepage. In CJK locales cp_dir might end with a double-byte
* character whose trailing byte is a backslash.
/*
* Append "/share/locale" or "/lib/locale" depending on whether
* autoconfigury detected GNU gettext or not.
*/
retval = g_strconcat (cp_dir, "\\lib\\locale", NULL);
g_free (cp_dir);
const char *p = GLIB_LOCALE_DIR + strlen (GLIB_LOCALE_DIR);
while (*--p != '/')
;
while (*--p != '/')
;
locale_dir = g_build_filename (install_dir, p, NULL);
retval = g_win32_locale_filename_from_utf8 (locale_dir);
g_free (install_dir);
g_free (locale_dir);
}
if (retval)