luci-base: zh_CN: update Simplified Chinese translation
[project/luci.git] / build / i18n-scan.pl
index cee07fd..899d90d 100755 (executable)
@@ -28,6 +28,7 @@ sub dec_tpl_str
        $s =~ s/[\s\n]+/ /g;
        $s =~ s/^ //;
        $s =~ s/ $//;
        $s =~ s/[\s\n]+/ /g;
        $s =~ s/^ //;
        $s =~ s/ $//;
+       $s =~ s/\\/\\\\/g;
        return $s;
 }
 
        return $s;
 }
 
@@ -51,6 +52,7 @@ if( open F, "find @ARGV -type f '(' -name '*.htm' -o -name '*.lua' ')' |" )
                        {
                                ( my $code, $text ) = extract_bracketed($text, q{('")});
 
                        {
                                ( my $code, $text ) = extract_bracketed($text, q{('")});
 
+                               $code =~ s/\\\n/ /g;
                                $code =~ s/^\([\n\s]*//;
                                $code =~ s/[\n\s]*\)$//;
 
                                $code =~ s/^\([\n\s]*//;
                                $code =~ s/[\n\s]*\)$//;
 
@@ -63,10 +65,14 @@ if( open F, "find @ARGV -type f '(' -name '*.htm' -o -name '*.lua' ')' |" )
                                        {
                                                ( $sub, $code ) = extract_delimited($code, q{'"}, q{\s*(?:\.\.\s*)?});
 
                                        {
                                                ( $sub, $code ) = extract_delimited($code, q{'"}, q{\s*(?:\.\.\s*)?});
 
-                                               if( defined $sub )
+                                               if( defined $sub && length($sub) > 2 )
                                                {
                                                        $res .= substr $sub, 1, length($sub) - 2;
                                                }
                                                {
                                                        $res .= substr $sub, 1, length($sub) - 2;
                                                }
+                                               else
+                                               {
+                                                       undef $sub;
+                                               }
                                        }
                                }
                                elsif( $code =~ /^(\[=*\[)/ )
                                        }
                                }
                                elsif( $code =~ /^(\[=*\[)/ )