From 37112539ef48c17968eb2d55fb8fc76b20329040 Mon Sep 17 00:00:00 2001 From: Daniel Albers Date: Tue, 31 Jan 2012 01:34:26 +0100 Subject: [PATCH] pull-from-transifex.sh: support multiple translators --- po/pull-from-transifex.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/po/pull-from-transifex.sh b/po/pull-from-transifex.sh index cbefc820..e5dd6b19 100755 --- a/po/pull-from-transifex.sh +++ b/po/pull-from-transifex.sh @@ -1,15 +1,15 @@ #!/bin/bash -tx pull && +tx pull $* && git add po/*.po && ( translators=$(while read mode pofile; do - translator=$(perl -ne 's/^"Last-Translator: (.*?)(?:\\n)?"$/\1/ && print $1;' ${pofile}) + translator=$(git diff --cached -- ${pofile} | perl -le 'while (<>) { if (/^\+(?:#|.*?:) *(.*?)(<[^@>]+@[^>]+>)/p) { $xltrs{$2} = $1 unless $xltrs{$2}; } last if /^\+"Last-Translator: /; }; push(@out, $n.$e) while (($e, $n) = each %xltrs); print(join(", ", @out));') lang=${pofile%.po} lang=${lang#po/} echo " - ${lang}: ${translator}" done < <(git status --porcelain po/*.po | egrep '^[AM] ')) - git commit -m "Update translations from Transifex + git commit -em "Update translations from Transifex Many thanks to: ${translators}" po/*.po -- 2.20.1