From: David Woodhouse Date: Sat, 23 Jun 2012 15:20:42 +0000 (+0200) Subject: Transifex import: Reduce churn, and don't forget to add new translations X-Git-Tag: v4.01~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b8dd756f11c7fb617a7327e237b7346e90d734e5;p=platform%2Fupstream%2Fopenconnect.git Transifex import: Reduce churn, and don't forget to add new translations Signed-off-by: David Woodhouse --- diff --git a/Makefile.am b/Makefile.am index 55c61eb..594ed69 100644 --- a/Makefile.am +++ b/Makefile.am @@ -105,11 +105,30 @@ update-translations: po/$(PACKAGE).pot @cd $(top_srcdir); if ! git diff-index --name-only --exit-code HEAD -- po/; then \ echo "*** ERROR: Uncommitted changes in above files"; exit 1; \ else \ + for a in po/*.po; do \ + msgmerge -q -F $$a $(abs_builddir)/po/$(PACKAGE).pot | grep -v PO-Revision-Date: > $$a.old ; \ + done && \ tx pull -af && \ for a in po/*.po; do \ - msgmerge -F $$a $(abs_builddir)/po/$(PACKAGE).pot > $$a.new && mv $$a.new $$a ; \ + msgmerge -q -F $$a $(abs_builddir)/po/$(PACKAGE).pot | grep -v PO-Revision-Date: > $$a.new ; \ + if ! git ls-tree --name-only HEAD $$a | grep -q $$a; then \ + echo New file $$a ; \ + git add $$a ; \ + elif ! cmp -s $$a.old $$a.new; then \ + echo New changes for $$a; \ + mv $$a.new $$a; \ + else \ + git checkout -f HEAD $$a ; \ + fi ; \ + rm -f $$a.old $$a.new ; \ done && \ - git commit -s -m "Update translations from Transifex" -- po/ ; \ + ls po/*.po | sed 's%^po/\(.*\)\.po%\1%' > po/LINGUAS ; \ + if ! git update-index -q --refresh --unmerged || \ + ! git diff-index --name-only --exit-code HEAD -- po/ >/dev/null; then \ + git commit -s -m "Update translations from Transifex" -- po/ ; \ + else \ + echo No changes to commit ; \ + fi ; \ fi upload-pot: po/$(PACKAGE).pot