From 7f2c5644543924da2eba00708070b3b612718f29 Mon Sep 17 00:00:00 2001 From: Laurent Monin Date: Sat, 19 Apr 2008 12:46:59 +0000 Subject: [PATCH] Add the possibility to update only one translation file using, for example: make update-po PO=fr autogen.sh applies a patch made against glib-gettextize generated Makefile.in.in --- autogen.sh | 3 +++ po/Makefile.in.in.patch | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 po/Makefile.in.in.patch diff --git a/autogen.sh b/autogen.sh index 50cfe962..73762605 100755 --- a/autogen.sh +++ b/autogen.sh @@ -85,6 +85,9 @@ do test -r $dr/aclocal.m4 || touch $dr/aclocal.m4 echo "Running glib-gettextize..." echo "no" | glib-gettextize --force --copy + if [ -r po/Makefile.in.in.patch ]; then + patch po/Makefile.in.in < po/Makefile.in.in.patch + fi echo "Making $dr/aclocal.m4 writable ..." test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4 fi diff --git a/po/Makefile.in.in.patch b/po/Makefile.in.in.patch new file mode 100644 index 00000000..9339be26 --- /dev/null +++ b/po/Makefile.in.in.patch @@ -0,0 +1,34 @@ +--- Makefile.in.in 2008-04-19 14:36:53.000000000 +0200 ++++ Makefile.in.in.new 2008-04-19 14:39:19.000000000 +0200 +@@ -216,7 +216,30 @@ + || cp -p $(srcdir)/$$file $(distdir); \ + done + +-update-po: Makefile ++### Updating po and gmo files ++# ++# Update by merging all .po files with the .po template master file. ++# ++# It is possible to update only a single .po file by setting the PO variable to ++# either or .po when calling make. Example: make update-po PO=is ++ ++update-po: Makefile $(GETTEXT_PACKAGE).pot ++ @cd $(srcdir); \ ++ $(foreach lang,$(basename $(if $(strip $(PO)),$(PO),$(CATALOGS))), \ ++ echo -n "$(lang): "; \ ++ if $(MSGMERGE) $(lang).po $(GETTEXT_PACKAGE).pot -o $(lang).new.po; then \ ++ mv -f $(lang).new.po $(lang).po; \ ++ else \ ++ echo "msgmerge failed!"; \ ++ rm -f $(lang).new.po; \ ++ fi; \ ++ ) ++ $(MAKE) update-gmo ++ ++update-gmo: Makefile $(CATALOGS) ++ @: ++ ++update-po-orig: Makefile + $(MAKE) $(GETTEXT_PACKAGE).pot + tmpdir=`pwd`; \ + cd $(srcdir); \ -- 2.20.1