Commit from LuCI Translation Portal by user jow.: 42 of 42 messages translated (0...
[project/luci.git] / build / i18n-scan.pl
index cee07fd..1243545 100755 (executable)
@@ -51,6 +51,7 @@ if( open F, "find @ARGV -type f '(' -name '*.htm' -o -name '*.lua' ')' |" )
                        {
                                ( my $code, $text ) = extract_bracketed($text, q{('")});
 
+                               $code =~ s/\\\n/ /g;
                                $code =~ s/^\([\n\s]*//;
                                $code =~ s/[\n\s]*\)$//;
 
@@ -59,11 +60,11 @@ if( open F, "find @ARGV -type f '(' -name '*.htm' -o -name '*.lua' ')' |" )
 
                                if( $code =~ /^['"]/ )
                                {
-                                       while( defined $sub )
+                                       while( defined $sub && length($sub) > 0 )
                                        {
                                                ( $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;
                                                }