pull-from-transifex.sh: always attribute Last-Translator
authorDaniel Albers <daniel@lbe.rs>
Mon, 6 Feb 2012 16:23:25 +0000 (17:23 +0100)
committerDaniel Albers <daniel@lbe.rs>
Tue, 14 Feb 2012 21:43:31 +0000 (22:43 +0100)
po/pull-from-transifex.sh

index e5dd6b1..bd513e6 100755 (executable)
@@ -3,7 +3,16 @@
 tx pull $* &&
 git add po/*.po && (
   translators=$(while read mode pofile; do
-    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));')
+    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}"