build: add i18n-merge-openwrt-19.07

Support backporting translation strings from 19.07 to 18.06 by adding a script for that.

Targeted workflow is:
1) sync 18.06 to apps
2) backport 19.07 translations
3) re-sync 18.06 just in case
4) backport master translations
5) re-sync 18.06 just in case

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
This commit is contained in:
Hannu Nyman
2020-05-15 16:59:59 +03:00
parent b4dbbb432e
commit de2df034e1

View File

@@ -0,0 +1,22 @@
#!/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;
my $returnCode = system("git show --format=\%B 'openwrt-19.07:$path' > '$ref'");
if ( $returnCode == 0 )
{
system('msgmerge', '-N', '-o', $path, $ref, $path);
system('msgattrib', '--no-obsolete', '-o', $path, $path);
} else {
print "...failed due to git error.\n";
}
unlink($ref);
}
close F;
}