From: Jo-Philipp Wich Date: Wed, 29 Jan 2020 07:29:17 +0000 (+0100) Subject: build: add script to merge master translation into branches X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=9b69e8f9cc41654e3b09352832c5154025bf2561;p=oweals%2Fluci.git build: add script to merge master translation into branches Signed-off-by: Jo-Philipp Wich (cherry picked from commit cab574958c580c38ca8dc852d8dada1681d62046) --- diff --git a/build/i18n-merge-master.pl b/build/i18n-merge-master.pl new file mode 100755 index 000000000..d7479efb8 --- /dev/null +++ b/build/i18n-merge-master.pl @@ -0,0 +1,17 @@ +#!/usr/bin/env perl + +if (open F, '-|', 'find', $ARGV[0] || '.', '-type', 'f', '-name', '*.po') { + while (defined(my $path = readline F)) { + chomp $path; + + (my $ref = $path) =~ s/\.po$/\.master.po/; + + printf 'Updating %s ', $path; + system("git show --format=\%B 'master:$path' > '$ref'"); + system('msgmerge', '-N', '-o', $path, $ref, $path); + system('msgattrib', '--no-obsolete', '-o', $path, $path); + unlink($ref); + } + + close F; +}