Show
Ignore:
Timestamp:
02.06.2016 19:19:53 (4 years ago)
Author:
ak19
Message:

Another bugfix in gtil.pl: regex was too greedy, must only discard until first closing square bracket. Else existing translations like es [truncado] for en [truncated] will be marked as needing translating, since the regex removing the language portion like [l=es] is too greedy.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/bin/script/gti.pl

    r30548 r30562  
    14221422    $chunk_text =~ s/^\"//; 
    14231423    $chunk_text =~ s/\"$//; 
    1424 } 
    1425  
    1426 # No, so it must be a text macro 
    1427 else { 
     1424    } 
     1425 
     1426    # No, so it must be a text macro 
     1427    else { 
    14281428    # Remove macro key 
    14291429    $chunk_text =~ s/^_([^_]+)_(\s*)//; 
    14301430     
    14311431    # Remove language specifier 
    1432     $chunk_text =~ s/^\[l=.*\](\s*)//; 
     1432    $chunk_text =~ s/^\[l=[^\]]*\](\s*)//; # only remove until first closing square bracket, ] 
    14331433     
    14341434    # Remove braces enclosing text 
    14351435    $chunk_text =~ s/^{(\s*)((.|\n)*)}(\s*)(\#.+\s*)?/$2/; 
    1436 } 
    1437  
    1438 return $chunk_text; 
     1436    } 
     1437 
     1438    return $chunk_text; 
    14391439} 
    14401440