From: Daniel Albers Date: Tue, 31 Jan 2012 00:34:26 +0000 (+0100) Subject: pull-from-transifex.sh: support multiple translators X-Git-Tag: 0.8-beta1~5 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=37112539ef48c17968eb2d55fb8fc76b20329040;hp=3ff1ec5b699a38e4a03deec4ea9576fade54cbbe pull-from-transifex.sh: support multiple translators --- 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