]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
gettext: make build system look more like automake gettext
authorArkadiusz Miśkiewicz <arekm@maven.pl>
Thu, 29 Jan 2009 22:24:45 +0000 (23:24 +0100)
committerChristoph Hellwig <hch@brick.lst.de>
Thu, 29 Jan 2009 22:24:45 +0000 (23:24 +0100)
configure.in: Find all *.c files using find so no need to update
po/Makefile manually (previous method leads to problems like when
someone adds new .c file and forgets to update Makefile - then
translations are removed after update).

po/Makefile: Use automaticly found .c files. Add update-po target.
Show translation statistics when processing po files. Turn on msgfmt
validation (-c).

How to update translations now?

 $ ./configure
 $ cd po; make update-po
 $ vim your.po
 $ make

Signed-off-by: Arkadiusz Miśkiewicz <arekm@maven.pl>
Reviewed-by: Christoph Hellwig <hch@lst.de>
configure.in
include/builddefs.in
include/buildrules
po/Makefile

index 6bd24215d843e4894355d93aef43da2b0754713f..4e4e50c74c06fcbfe1c5a59a4257e38689de5b78 100644 (file)
@@ -35,6 +35,13 @@ AC_ARG_ENABLE(lib64,
        enable_lib64=no)
 AC_SUBST(enable_lib64)
 
+# Find localized files
+LOCALIZED_FILES=""
+for lfile in `find ${srcdir} -name '*.c' -type f || exit 1`; do
+    LOCALIZED_FILES="$LOCALIZED_FILES \$(TOPDIR)/$lfile"
+done
+AC_SUBST(LOCALIZED_FILES)
+
 AC_PACKAGE_GLOBALS(xfsprogs)
 AC_PACKAGE_UTILITIES(xfsprogs)
 AC_MULTILIB($enable_lib64)
index f07d8d6487515b020bee0d691b7fd6e0ae5b01a6..49e2722465dba3672605fc66ff91ca92caca8886 100644 (file)
@@ -74,6 +74,7 @@ MAKEDEPEND    = @makedepend@
 MSGFMT         = @msgfmt@
 MSGMERGE       = @msgmerge@
 XGETTEXT       = @xgettext@
+LOCALIZED_FILES        = @LOCALIZED_FILES@
 
 RPM            = @rpm@
 RPMBUILD       = @rpmbuild@
index 1047ec339a840e6bbd7dea46b0f09bf844e271c5..f2a33727285ff22c8cf686fa2593fde5a65a3309 100644 (file)
@@ -42,14 +42,24 @@ ifdef POTHEAD
 $(POTHEAD): $(XGETTEXTFILES)
        $(XGETTEXT) --language=C --keyword=_ --keyword=N_ -o $@ $(XGETTEXTFILES)
 
-# Generate temp .po files, to check whether translations need updating.
-# Not by default, due to gettext output differences between versions.
-%.po: $(POTHEAD)
-#      $(MSGMERGE) -o $@.tmpo $@ $(POTHEAD)
-#      if ! diff $@.tmpo $@ >/dev/null; then echo "$@ dated, see $@.tmpo"; fi
+# Update translations
+update-po: $(POTHEAD) $(wildcard $(TOPDIR)/po/*.po)
+       catalogs=$(wildcard $(TOPDIR)/po/*.po); \
+       for cat in $$catalogs; do \
+         lang=`basename $$cat .po`; \
+         mv $$lang.po $$lang.old.po; \
+         echo "$$lang:"; \
+         if $(MSGMERGE) $$lang.old.po $(POTHEAD) -o $$lang.po; then \
+           rm -f $$lang.old.po; \
+         else \
+           echo "msgmerge for $$lang failed!"; \
+           rm -f $$lang.po; \
+           mv $$lang.old.po $$lang.po; \
+         fi; \
+       done
 
 %.mo: %.po
-       $(MSGFMT) -o $@ $<
+       $(MSGFMT) -c --statistics -o $@ $<
 endif
 
 source :
index c6ccf60585831857aa0384dc7d426f4f5acb692e..ac7d43ff7331f2b80edf91fc222586d035f737dd 100644 (file)
@@ -10,97 +10,7 @@ LINGUAS = pl
 LSRCFILES = $(LINGUAS:%=%.po) $(POTHEAD)
 LDIRT = $(POTHEAD)
 
-# TODO: db/ logprint/
-XGETTEXTFILES =        \
-               $(TOPDIR)/copy/xfs_copy.c \
-               $(TOPDIR)/estimate/xfs_estimate.c \
-               $(TOPDIR)/growfs/xfs_growfs.c \
-               $(TOPDIR)/io/attr.c \
-               $(TOPDIR)/io/bmap.c \
-               $(TOPDIR)/io/fadvise.c \
-               $(TOPDIR)/io/file.c \
-               $(TOPDIR)/io/freeze.c \
-               $(TOPDIR)/io/fsync.c \
-               $(TOPDIR)/io/getrusage.c \
-               $(TOPDIR)/io/imap.c \
-               $(TOPDIR)/io/init.c \
-               $(TOPDIR)/io/inject.c \
-               $(TOPDIR)/io/madvise.c \
-               $(TOPDIR)/io/mincore.c \
-               $(TOPDIR)/io/mmap.c \
-               $(TOPDIR)/io/open.c \
-               $(TOPDIR)/io/parent.c \
-               $(TOPDIR)/io/pread.c \
-               $(TOPDIR)/io/prealloc.c \
-               $(TOPDIR)/io/pwrite.c \
-               $(TOPDIR)/io/resblks.c \
-               $(TOPDIR)/io/sendfile.c \
-               $(TOPDIR)/io/shutdown.c \
-               $(TOPDIR)/io/truncate.c \
-               $(TOPDIR)/libdisk/dm.c \
-               $(TOPDIR)/libdisk/drivers.c \
-               $(TOPDIR)/libdisk/evms.c \
-               $(TOPDIR)/libdisk/fstype.c \
-               $(TOPDIR)/libdisk/lvm.c \
-               $(TOPDIR)/libdisk/md.c \
-               $(TOPDIR)/libdisk/pttype.c \
-               $(TOPDIR)/libdisk/xvm.c \
-               $(TOPDIR)/libxcmd/command.c \
-               $(TOPDIR)/libxcmd/help.c \
-               $(TOPDIR)/libxcmd/input.c \
-               $(TOPDIR)/libxcmd/paths.c \
-               $(TOPDIR)/libxcmd/projects.c \
-               $(TOPDIR)/libxcmd/quit.c \
-               $(TOPDIR)/libxfs/darwin.c \
-               $(TOPDIR)/libxfs/freebsd.c \
-               $(TOPDIR)/libxfs/init.c \
-               $(TOPDIR)/libxfs/irix.c \
-               $(TOPDIR)/libxfs/linux.c \
-               $(TOPDIR)/libxfs/rdwr.c \
-               $(TOPDIR)/libxfs/trans.c \
-               $(TOPDIR)/libxfs/util.c \
-               $(TOPDIR)/libxlog/util.c \
-               $(TOPDIR)/mkfs/proto.c \
-               $(TOPDIR)/mkfs/xfs_mkfs.c \
-               $(TOPDIR)/quota/edit.c \
-               $(TOPDIR)/quota/free.c \
-               $(TOPDIR)/quota/init.c \
-               $(TOPDIR)/quota/path.c \
-               $(TOPDIR)/quota/project.c \
-               $(TOPDIR)/quota/quot.c \
-               $(TOPDIR)/quota/quota.c \
-               $(TOPDIR)/quota/report.c \
-               $(TOPDIR)/quota/state.c \
-               $(TOPDIR)/quota/util.c \
-               $(TOPDIR)/repair/agheader.c \
-               $(TOPDIR)/repair/attr_repair.c \
-               $(TOPDIR)/repair/avl.c \
-               $(TOPDIR)/repair/avl64.c \
-               $(TOPDIR)/repair/bmap.c \
-               $(TOPDIR)/repair/dino_chunks.c \
-               $(TOPDIR)/repair/dinode.c \
-               $(TOPDIR)/repair/dir.c \
-               $(TOPDIR)/repair/dir2.c \
-               $(TOPDIR)/repair/incore.c \
-               $(TOPDIR)/repair/incore_ext.c \
-               $(TOPDIR)/repair/incore_ino.c \
-               $(TOPDIR)/repair/init.c \
-               $(TOPDIR)/repair/phase1.c \
-               $(TOPDIR)/repair/phase2.c \
-               $(TOPDIR)/repair/phase3.c \
-               $(TOPDIR)/repair/phase4.c \
-               $(TOPDIR)/repair/phase5.c \
-               $(TOPDIR)/repair/phase6.c \
-               $(TOPDIR)/repair/phase7.c \
-               $(TOPDIR)/repair/prefetch.c \
-               $(TOPDIR)/repair/progress.c \
-               $(TOPDIR)/repair/rt.c \
-               $(TOPDIR)/repair/sb.c \
-               $(TOPDIR)/repair/scan.c \
-               $(TOPDIR)/repair/threads.c \
-               $(TOPDIR)/repair/versions.c \
-               $(TOPDIR)/repair/xfs_repair.c \
-               $(TOPDIR)/rtcp/xfs_rtcp.c
+XGETTEXTFILES =        $(LOCALIZED_FILES)
 
 default: $(POTHEAD) $(LINGUAS:%=%.mo)