[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] Do not use gettextize and i18n round 2 Re: I18n: The gettext proposal

From: Greg Stein <gstein_at_lyra.org>
Date: 2004-03-30 23:36:54 CEST

On Tue, Mar 30, 2004 at 10:28:42AM -0800, Justin Erenkrantz wrote:
>...
> * Makefile.in: Add localedir, MSGFMT, PACKAGE_NAME, PACKAGE_VERSION substs from
> configure; add in build-i18n and install-i18n targets
> [installs to right location for Solaris; no clue about GNU gettext]
> * configure.in: Remove old placeholder for GNU gettext and move down to a
> more sensible location; add in i18n config section which enables NLS iff
> msgfmt is found; export SVN_LOCALE_DIR properly escaped so main.c can use;
> if i18n enabled, add in build-i18n and install-i18n targets

You don't mention the ALL_LINGUAS variable. And that is one that I'd like
to complain about :-)

I would *much* prefer that we put the "po" path into build.conf and have
gen-build look in that directory for .po files. Then it can create a bunch
of dependency lines for the files, create some roll-up symbols, and then
we can use that simple dependency mechanism in the top-level Makefile.

Basically, I think if you have a 'for' loop in a Makefile, then you're not
using 'make' and gen-build as well as we could.

>...
> +PACKAGE_NAME=@PACKAGE_NAME@
> +PACKAGE_VERSION=@PACKAGE_VERSION@

PACKAGE_VERSION isn't used. I also worry about a single PACKAGE_NAME,
given Nicolas' point about libraries vs executables. Can we get away with
a single package name? Or will we need to use, say, 'subversion' and
'libsvn' ?

>...
> +build-i18n:
> + @list='$(ALL_LINGUAS)'; \
> + for i in $$list; do \
> + $(MSGFMT) -o po/$$i.mo $(srcdir)/po/$$i.po; \
> + done
> +
> +install-i18n:
> + $(MKDIR) $(DESTDIR)$(localedir)
> + @list='$(ALL_LINGUAS)'; \
> + for i in $$list; do \
> + $(INSTALL_DATA) po/$$i.mo
> $(DESTDIR)$(localedir)/$$i/LC_MESSAGES/$(PACKAGE_NAME).mo; \
> + done

These ought to be redone in favor of gen-build producing deps for us.

>...
> +++ configure.in (working copy)
>...
> +dnl I18n -------------------
>
> +localedir='${datadir}/locale'
> +localedir="${localedir}/subversion-${svn_version}"
> +AC_SUBST(localedir)

That doesn't seem to follow the pattern on my RedHat 9.0 box. I have:

  /usr/share/locale/$(LANGUAGE)/LC_MESSAGES/$(PACKAGE).mo

I'm not sure about the best way to handle this, given the different
platform and implementation layouts.

> +dnl Set of available languages.
> +dnl ALL_LINGUAS="de fr es ko nl no pl pt sl sv"
> +dnl I volunteer for this ^^ translation :-) -xbc
> +ALL_LINGUAS="es"
> +AC_SUBST(ALL_LINGUAS)

See above about this.

>...
> +AH_BOTTOM(
> +#define N_(x) (x)
> +#ifdef ENABLE_NLS
> +#include <locale.h>
> +#include <libintl.h>
> +#define _(x) dgettext(PACKAGE_NAME, x)
> +#else
> +#define _(x) (x)
> +#endif
> +)

I think you'll have to add this to the svn_private_config.hw file.
Alternatively, this kind of stuff can go into second file which then gets
#include'd from the (two) svn_private_config.h files.

>...
> +++ subversion/clients/cmdline/main.c (working copy)
>...
> @@ -656,6 +658,12 @@
> svn_cl__cmd_baton_t command_baton;
> svn_auth_baton_t *ab;
> svn_config_t *cfg;
> +
> +#ifdef ENABLE_NLS
> + setlocale (LC_ALL, "");
> + bindtextdomain (PACKAGE_NAME, SVN_LOCALE_DIR);
> + textdomain (PACKAGE_NAME);
> +#endif
>
> /* Initialize the app. */
> if (svn_cmdline_init ("svn", stderr) != EXIT_SUCCESS)

I think your changes will need to go into svn_cmdline_init(), and be
coordinated with the setlocale() call in there.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Mar 30 23:35:49 2004

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.