Skip to content

Commit

Permalink
fix test language creation to preserve special chars and variable pla…
Browse files Browse the repository at this point in the history
…cholders
  • Loading branch information
WayneBooth committed May 4, 2013
1 parent c47a4f6 commit 0e7c646
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions scripts/build-local-versions.pl
Expand Up @@ -171,18 +171,26 @@ sub generate_test_language {
if ( $file =~ /includes\/local/ ) {
# A javascript localise resource file
my ( $key, $data ) = $line =~ /^(.*) = '(.*)';/;
$data =~ s/\%s/__/g;
$data =~ s/[^\s_]/#/g;
$data =~ s/__/%s/g;
$data =~ s/\%s/ß/g;
$data =~ s/\%d/ð/g;
$data =~ s/\\n/@/g;
$data =~ s/[^\sßð@]/#/g;
$data =~ s/ß/%s/g;
$data =~ s/ð/%d/g;
$data =~ s/@/\\n/g;
$data =~ s/_/#/g;
print TARGET "$key = '$data';\n";
}
else {
# An application resource file
my ( $key, $data ) = split( /\|/, $line );
$data =~ s/\%s/__/g;
$data =~ s/[^\s_]/#/g;
$data =~ s/__/%s/g;
$data =~ s/\%s/ß/g;
$data =~ s/\%d/ð/g;
$data =~ s/\\n/@/g;
$data =~ s/[^\sßð@]/#/g;
$data =~ s/ß/%s/g;
$data =~ s/ð/%d/g;
$data =~ s/@/\\n/g;
$data =~ s/_/#/g;
print TARGET "$key|$data\n";
}
Expand Down

0 comments on commit 0e7c646

Please sign in to comment.