From: Jo-Philipp Wich Date: Tue, 19 May 2009 17:21:07 +0000 (+0000) Subject: build: add i18n-update.pl to refresh *.po files from *.pot templates X-Git-Tag: 0.9.0~411 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=1f3666f7225eb33d932a7ae067dbca05e57ad9ca;p=oweals%2Fluci.git build: add i18n-update.pl to refresh *.po files from *.pot templates --- diff --git a/build/i18n-update.pl b/build/i18n-update.pl new file mode 100755 index 000000000..c41b039b7 --- /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; +}