mirror of
https://github.com/openwrt/luci.git
synced 2025-12-21 17:04:35 +04:00
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:
22
build/i18n-merge-openwrt-1907.pl
Executable file
22
build/i18n-merge-openwrt-1907.pl
Executable 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;
|
||||
}
|
||||
Reference in New Issue
Block a user