Fix gnc_path_get_localedir() because binreloc's implementation did not

respect the choice of DATADIRNAME from AM_GLIB_GNU_GETTEXT in configure.



git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15132 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Christian Stimming
2006-11-24 13:14:41 +00:00
parent efe2a9fc12
commit 462cebb82f
7 changed files with 21 additions and 38 deletions

View File

@@ -1,3 +1,9 @@
2006-11-24 Christian Stimming <stimming@tuhh.de>
* src/engine/gnc-path.c: Fix gnc_path_get_localedir() because
binreloc's implementation did not respect the choice of
DATADIRNAME from AM_GLIB_GNU_GETTEXT in configure.
2006-11-20 Derek Atkins <derek@ihtfp.com>
* src/import-export/qif-import/qif-parse.scm:

View File

@@ -836,10 +836,17 @@ AC_SUBST(HBCI_DIR)
### --------------------------------------------------------------------------
### i18n
# This variable is set by GLIB_WITH_NLS, called through
# AM_GLIB_GNU_GETTEXT above, and it is "lib" on e.g. windows
if test "x$DATADIRNAME" = "x"; then
DATADIRNAME="share"
AC_SUBST(DATADIRNAME)
fi
AC_ARG_WITH( locale-dir,
[ --with-locale-dir=PATH specify where to look for locale-specific information],
LOCALE_DIR="$with_locale_dir",
LOCALE_DIR="\${prefix}/share/locale")
LOCALE_DIR="\${prefix}/${DATADIRNAME}/locale")
AC_SUBST(LOCALE_DIR)

View File

@@ -182,6 +182,7 @@ gncla-dir.h: gncla-dir.h.in ${top_builddir}/config.status Makefile
rm -f $@.tmp
sed < $< > $@.tmp \
-e 's#@-LOCALE_DIR-@#${LOCALE_DIR}#g' \
-e 's#@-DATADIRNAME-@#${DATADIRNAME}#g' \
-e 's#@-GNC_ACCOUNTS_DIR-@#${GNC_ACCOUNTS_DIR}#g' \
-e 's#@-GNC_GLADE_DIR-@#${GNC_GLADE_DIR}#g' \
-e 's#@-GCONF_SCHEMA_CONFIG_SOURCE_DIRONLY-@#${GCONF_SCHEMA_CONFIG_SOURCE_DIRONLY}#g' \

View File

@@ -590,39 +590,6 @@ gbr_find_data_dir (const gchar *default_data_dir)
}
/** Locate the application's localization folder.
*
* The path is generated by the following pseudo-code evaluation:
* \code
* prefix + "/share/locale"
* \endcode
*
* @param default_locale_dir A default path which will used as fallback.
* @return A string containing the localization folder's path, which must be freed when
* no longer necessary. If BinReloc is not initialized, or if the
* initialization function failed, then a copy of default_locale_dir will be returned.
* If default_locale_dir is NULL, then NULL will be returned.
*/
gchar *
gbr_find_locale_dir (const gchar *default_locale_dir)
{
gchar *data_dir, *dir;
data_dir = gbr_find_data_dir (NULL);
if (data_dir == NULL) {
/* BinReloc not initialized. */
if (default_locale_dir != NULL)
return g_strdup (default_locale_dir);
else
return NULL;
}
dir = g_build_filename (data_dir, "locale", NULL);
g_free (data_dir);
return dir;
}
/** Locate the application's library folder.
*
* The path is generated by the following pseudo-code evaluation:

View File

@@ -41,7 +41,6 @@ typedef enum {
#define gbr_find_bin_dir ffEt66859784967989_gbr_find_bin_dir
#define gbr_find_sbin_dir ffEt66859784967989_gbr_find_sbin_dir
#define gbr_find_data_dir ffEt66859784967989_gbr_find_data_dir
#define gbr_find_locale_dir ffEt66859784967989_gbr_find_locale_dir
#define gbr_find_lib_dir ffEt66859784967989_gbr_find_lib_dir
#define gbr_find_libexec_dir ffEt66859784967989_gbr_find_libexec_dir
#define gbr_find_etc_dir ffEt66859784967989_gbr_find_etc_dir
@@ -57,7 +56,6 @@ gchar *gbr_find_prefix (const gchar *default_prefix);
gchar *gbr_find_bin_dir (const gchar *default_bin_dir);
gchar *gbr_find_sbin_dir (const gchar *default_sbin_dir);
gchar *gbr_find_data_dir (const gchar *default_data_dir);
gchar *gbr_find_locale_dir (const gchar *default_locale_dir);
gchar *gbr_find_lib_dir (const gchar *default_lib_dir);
gchar *gbr_find_libexec_dir (const gchar *default_libexec_dir);
gchar *gbr_find_etc_dir (const gchar *default_etc_dir);

View File

@@ -100,8 +100,11 @@ gchar *gnc_path_get_gladedir()
* @returns A newly allocated string. */
gchar *gnc_path_get_localedir()
{
//printf("Returning localedir %s\n", gbr_find_locale_dir (LOCALE_DIR));
return gbr_find_locale_dir (LOCALE_DIR);
gchar *prefix = gnc_path_get_prefix();
gchar *result = g_build_filename (prefix, LOCALE_DATADIRNAME, "locale", (char*)NULL);
g_free (prefix);
//printf("Returning localedir %s\n", result);
return result;
}
/** Returns the glade file path, usually

View File

@@ -31,6 +31,7 @@
#define PKGLIBDIR "@-pkglibdir-@"
#define LOCALE_DIR "@-LOCALE_DIR-@"
#define LOCALE_DATADIRNAME "@-DATADIRNAME-@"
#define GNC_ACCOUNTS_DIR "@-GNC_ACCOUNTS_DIR-@"
#define GNC_GLADE_DIR "@-GNC_GLADE_DIR-@"