From 9bc9eae960a160e50da2f5611d273763816e430b Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Tue, 18 Jan 2011 20:54:24 +0000 Subject: [PATCH] luci-0.10: partly revert r6749 --- build/i18n-po2lua.pl | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 build/i18n-po2lua.pl diff --git a/build/i18n-po2lua.pl b/build/i18n-po2lua.pl new file mode 100755 index 000000000..5129055ff --- /dev/null +++ b/build/i18n-po2lua.pl @@ -0,0 +1,27 @@ +#!/usr/bin/perl + +@ARGV == 2 || die "Usage: $0 \n"; + +my $source_dir = shift @ARGV; +my $target_dir = shift @ARGV; + +if( ! -d $target_dir ) +{ + system('mkdir', '-p', $target_dir); +} + +if( open F, "find $source_dir -type f -name '*.po' |" ) +{ + while( chomp( my $file = readline F ) ) + { + my ( $lang, $basename ) = $file =~ m{.+/(\w+)/([^/]+)\.po$}; + $lang = lc $lang; + $lang =~ s/_/-/g; + + printf "Generating %-40s ", "$target_dir/$basename.$lang.lmo"; + system("./build/po2lmo", $file, "$target_dir/$basename.$lang.lmo"); + print ( -f "$target_dir/$basename.$lang.lmo" ? "done\n" : "empty\n" ); + } + + close F; +} -- 2.25.1