X-Git-Url: http://git.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=build%2Fi18n-update.pl;fp=build%2Fi18n-update.pl;h=c41b039b7d0a4f37b51cd9421425c6ba58c94ad7;hp=0000000000000000000000000000000000000000;hb=1f3666f7225eb33d932a7ae067dbca05e57ad9ca;hpb=79b473f5d5cac0fd6ee711ae1faab2142b91616a diff --git a/build/i18n-update.pl b/build/i18n-update.pl new file mode 100755 index 0000000000..c41b039b7d --- /dev/null +++ b/build/i18n-update.pl @@ -0,0 +1,22 @@ +#!/usr/bin/perl + +@ARGV >= 1 || die "Usage: $0 []\n"; + +my $source = shift @ARGV; +my $pattern = shift @ARGV || '*.po'; + +if( open F, "find $source -type f -name '$pattern' |" ) +{ + while( chomp( my $file = readline F ) ) + { + my ( $basename ) = $file =~ m{.+/([^/]+)\.po$}; + + if( -f "$source/templates/$basename.pot" ) + { + printf "Updating %-40s", $file; + system("msgmerge", "-U", $file, "$source/templates/$basename.pot"); + } + } + + close F; +}