X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=build%2Fi18n-scan.pl;h=899d90d22c282ada2e203cc249a75a52aa51aa83;hp=3f732710963258e25454ffe06ddf2072edc82791;hb=0bfe064cc3f6c17cae6035d4a87066cdb6464078;hpb=14a9306e7d088455bd63bbf4ef65866e74f05ce2;ds=sidebyside diff --git a/build/i18n-scan.pl b/build/i18n-scan.pl index 3f7327109..899d90d22 100755 --- a/build/i18n-scan.pl +++ b/build/i18n-scan.pl @@ -28,6 +28,7 @@ sub dec_tpl_str $s =~ s/[\s\n]+/ /g; $s =~ s/^ //; $s =~ s/ $//; + $s =~ s/\\/\\\\/g; return $s; } @@ -64,14 +65,14 @@ if( open F, "find @ARGV -type f '(' -name '*.htm' -o -name '*.lua' ')' |" ) { ( $sub, $code ) = extract_delimited($code, q{'"}, q{\s*(?:\.\.\s*)?}); - if( length($sub) < 1 ) { - undef $sub; - } - - if( defined $sub ) + if( defined $sub && length($sub) > 2 ) { $res .= substr $sub, 1, length($sub) - 2; } + else + { + undef $sub; + } } } elsif( $code =~ /^(\[=*\[)/ )