diff --git a/WINGs/po/Makefile.am b/WINGs/po/Makefile.am index 857730d5..3c0a2487 100644 --- a/WINGs/po/Makefile.am +++ b/WINGs/po/Makefile.am @@ -79,14 +79,18 @@ SUFFIXES = .po .mo all-local: $(CATALOGS) + +if HAVE_XGETTEXT $(DOMAIN).pot: $(POTFILES) - xgettext --default-domain=$(DOMAIN) \ - --add-comments --keyword=_ --keyword=N_ $(POTFILES) - if cmp -s $(DOMAIN).po $(DOMAIN).pot; then \ + $(AM_V_GEN)$(XGETTEXT) --default-domain=$(DOMAIN) \ + --add-comments --keyword=_ --keyword=N_ $(POTFILES) + @if cmp -s $(DOMAIN).po $(DOMAIN).pot; then \ rm -f $(DOMAIN).po; \ else \ mv -f $(DOMAIN).po $(DOMAIN).pot; \ fi +endif + install-data-local: $(CATALOGS) $(mkinstalldirs) $(DESTDIR)$(nlsdir) diff --git a/WPrefs.app/po/Makefile.am b/WPrefs.app/po/Makefile.am index 21c23d33..2f9401d8 100644 --- a/WPrefs.app/po/Makefile.am +++ b/WPrefs.app/po/Makefile.am @@ -45,14 +45,17 @@ SUFFIXES = .po .mo all-local: $(CATALOGS) + +if HAVE_XGETTEXT $(DOMAIN).pot: $(POTFILES) - xgettext --default-domain=$(DOMAIN) \ - --add-comments --keyword=_ --keyword=N_ $(POTFILES) - if cmp -s $(DOMAIN).po $(DOMAIN).pot; then \ + $(AM_V_GEN)$(XGETTEXT) --default-domain=$(DOMAIN) \ + --add-comments --keyword=_ --keyword=N_ $(POTFILES) + @if cmp -s $(DOMAIN).po $(DOMAIN).pot; then \ rm -f $(DOMAIN).po; \ else \ mv -f $(DOMAIN).po $(DOMAIN).pot; \ fi +endif install-data-local: $(CATALOGS) diff --git a/configure.ac b/configure.ac index 95500ab0..d1161b5d 100644 --- a/configure.ac +++ b/configure.ac @@ -417,17 +417,9 @@ dnl ==================== dnl Detect the language for translations to be installed and check dnl that the gettext environment works WM_I18N_LANGUAGES +WM_I18N_XGETTEXT -AC_CHECK_PROG(XGETTEXT, xgettext, xgettext) - -if test "$XGETTEXT" != ""; then - if $XGETTEXT --help 2>&1 | grep illegal >/dev/null ; then - echo "xgettext isn't GNU version" - XGETTEXT="" - fi -fi - dnl Added by Oliver - Support for NLSDIR option dnl =========================================== AC_ARG_WITH(nlsdir, AS_HELP_STRING([--with-nlsdir=PATH], [specify where the locale stuff should go])) diff --git a/m4/wm_i18n.m4 b/m4/wm_i18n.m4 index 7059c4a9..7a6340e0 100644 --- a/m4/wm_i18n.m4 +++ b/m4/wm_i18n.m4 @@ -92,3 +92,19 @@ AC_SUBST([WMAKERMOFILES])dnl AC_SUBST([WPREFSMOFILES])dnl AC_SUBST([UTILMOFILES])dnl ]) + + +# WM_I18N_XGETTEXT +# ---------------- +# +# xgettext is used to generate the Templates for translation, it is not +# mandatory for users, only for translation teams. We look for it even +# if I18N was not asked because it can be used by dev team. +AC_DEFUN_ONCE([WM_I18N_XGETTEXT], +[AC_CHECK_PROGS([XGETTEXT], [xgettext], []) +AS_IF([test "x$XGETTEXT" != "x"], + AS_IF([$XGETTEXT --help 2>&1 | grep "illegal" > /dev/null], + [AC_MSG_WARN([[$XGETTEXT is not GNU version, ignoring]]) + XGETTEXT=""])) +AM_CONDITIONAL([HAVE_XGETTEXT], [test "x$XGETTEXT" != "x"])dnl +]) diff --git a/po/Makefile.am b/po/Makefile.am index f8d4e840..55756fb7 100644 --- a/po/Makefile.am +++ b/po/Makefile.am @@ -74,14 +74,18 @@ SUFFIXES = .po .mo all-local: $(CATALOGS) + +if HAVE_XGETTEXT $(DOMAIN).pot: $(POTFILES) - xgettext --default-domain=$(DOMAIN) \ - --add-comments --keyword=_ --keyword=N_ $(POTFILES) - if cmp -s $(DOMAIN).po $(DOMAIN).pot; then \ + $(AM_V_GEN)$(XGETTEXT) --default-domain=$(DOMAIN) \ + --add-comments --keyword=_ --keyword=N_ $(POTFILES) + @if cmp -s $(DOMAIN).po $(DOMAIN).pot; then \ rm -f $(DOMAIN).po; \ else \ mv -f $(DOMAIN).po $(DOMAIN).pot; \ fi +endif + install-data-local: $(CATALOGS) $(mkinstalldirs) $(DESTDIR)$(nlsdir) diff --git a/util/po/Makefile.am b/util/po/Makefile.am index d1b113cf..53d895bd 100644 --- a/util/po/Makefile.am +++ b/util/po/Makefile.am @@ -20,14 +20,17 @@ SUFFIXES = .po .mo all-local: $(CATALOGS) + +if HAVE_XGETTEXT $(DOMAIN).pot: $(POTFILES) - xgettext --default-domain=$(DOMAIN) \ - --add-comments --keyword=_ --keyword=N_ $(POTFILES) - if cmp -s $(DOMAIN).po $(DOMAIN).pot; then \ + $(AM_V_GEN)$(XGETTEXT) --default-domain=$(DOMAIN) \ + --add-comments --keyword=_ --keyword=N_ $(POTFILES) + @if cmp -s $(DOMAIN).po $(DOMAIN).pot; then \ rm -f $(DOMAIN).po; \ else \ mv -f $(DOMAIN).po $(DOMAIN).pot; \ fi +endif install-data-local: $(CATALOGS)