forked from len0rd/rockbox
check for quotes better and warn/skip bad ones
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2592 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
567d84aa21
commit
1017e25438
2 changed files with 18 additions and 7 deletions
|
|
@ -89,14 +89,18 @@ while(<LANG>) {
|
||||||
$value = $set{'eng'};
|
$value = $set{'eng'};
|
||||||
}
|
}
|
||||||
|
|
||||||
$value =~ s/^\"(.*)\"/$1/g;
|
if($value =~ s/^\"(.*)\"/$1/g) {
|
||||||
|
|
||||||
$idnum = $idnum{$set{'id'}};
|
$idnum = $idnum{$set{'id'}};
|
||||||
$idnum{$set{'id'}} = '_done_';
|
$idnum{$set{'id'}} = '_done_';
|
||||||
|
|
||||||
printf OFILE ("%c%c%s\x00",
|
printf OFILE ("%c%c%s\x00",
|
||||||
($idnum>>8), ($idnum&0xff),
|
($idnum>>8), ($idnum&0xff),
|
||||||
$value);
|
$value);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
warn "String for ".$set{'id'}." misses quotes\n";
|
||||||
|
}
|
||||||
|
|
||||||
undef %set;
|
undef %set;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,7 @@ MOO
|
||||||
|
|
||||||
open(LANG, "<$input");
|
open(LANG, "<$input");
|
||||||
while(<LANG>) {
|
while(<LANG>) {
|
||||||
|
$line++;
|
||||||
if($_ =~ / *\#/) {
|
if($_ =~ / *\#/) {
|
||||||
# comment
|
# comment
|
||||||
next;
|
next;
|
||||||
|
|
@ -56,10 +57,16 @@ while(<LANG>) {
|
||||||
$_ =~ s/\r//g;
|
$_ =~ s/\r//g;
|
||||||
if($_ =~ / *([a-z]+): *(.*)/) {
|
if($_ =~ / *([a-z]+): *(.*)/) {
|
||||||
($var, $value) = ($1, $2);
|
($var, $value) = ($1, $2);
|
||||||
# print "$var => $value\n";
|
# print "$var => $value\n";
|
||||||
|
|
||||||
$set{$var} = $value;
|
$set{$var} = $value;
|
||||||
|
|
||||||
|
if( (($var eq "new") && $value && ($value !~ /^\"(.*)\"$/)) ||
|
||||||
|
(($var eq "eng") && ($value !~ /^\"(.*)\"$/)) ) {
|
||||||
|
print "missing quotes on line $line for ".$set{'id'}."\n";
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
|
||||||
if($var eq "new") {
|
if($var eq "new") {
|
||||||
# the last one for a single phrase
|
# the last one for a single phrase
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue