X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=po%2Fpull-from-transifex.sh;h=bd513e6aef5b068789cc69b8b5e7adaf4c75c680;hp=cbefc820e500e0974ab8f96181c6f844ea3dddc8;hb=812c2b2dbdf370e6717d81cffca9de3744a94620;hpb=e60960e560a45f4f732dd1066af5ba71c04e60ea diff --git a/po/pull-from-transifex.sh b/po/pull-from-transifex.sh index cbefc820..bd513e6a 100755 --- a/po/pull-from-transifex.sh +++ b/po/pull-from-transifex.sh @@ -1,15 +1,24 @@ #!/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 (/^(?:\+(?:#|.*?:)|[ +]"Last-Translator:) *(.*?)(<[^@>]+@[^>]+>)/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