mirror of
https://github.com/openwrt/luci
synced 2025-01-09 04:28:37 +08:00
build: add script to merge master translation into branches
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit cab574958c
)
This commit is contained in:
parent
733734ab20
commit
9b69e8f9cc
17
build/i18n-merge-master.pl
Executable file
17
build/i18n-merge-master.pl
Executable file
@ -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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user