Merge pull request #1003 from stangri/luci-app-vpnbypass
[project/luci.git] / build / i18n-scan.pl
index 3f73271..899d90d 100755 (executable)
@@ -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 =~ /^(\[=*\[)/ )