1
0
Fork 0
forked from len0rd/rockbox

Now correctly generates language files, ignoring voice entries

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4532 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Linus Nielsen Feltzing 2004-04-21 06:39:52 +00:00
parent bf8c3056f9
commit 9a4a5e9834

View file

@ -64,10 +64,21 @@ while(<ENG>) {
($var, $value) = ($1, $2);
$set{$var} = $value;
# "new" is always the last one, so now we have them all
if($var eq "new") {
# the last one for a single phrase
$value = $set{'eng'};
if($value =~ s/^\"(.*)\"\s*$/$1/g) {
# Skip voice-only entries
if(!$value && $set{'voice'}) {
$idnum{$set{'id'}} = '_done_';
next;
}
# Assign an ID number to this entry
$idnum{$set{'id'}}=$idnum;
$idnum++;
}
undef %set;
}
}
@ -83,12 +94,15 @@ while(<LANG>) {
$_ =~ s/\r//g;
if($_ =~ /^ *([a-z]+): *(.*)/) {
($var, $value) = ($1, $2);
# print "$var => $value\n";
$set{$var} = $value;
# "new" is always the last one, so now we have them all
if($var eq "new") {
# the last one for a single phrase
$idnum = $idnum{$set{'id'}};
# Skip already processed entries (like voice-only ones)
next if($idnum eq '_done_');
if(!$value) {
# if not set, get the english version
@ -96,15 +110,6 @@ while(<LANG>) {
}
if($value =~ s/^\"(.*)\"\s*$/$1/g) {
# Skip voice-only entries
if(!$value && $set{'voice'}) {
$idnum{$set{'id'}} = '_done_';
next;
}
$idnum = $idnum{$set{'id'}};
if($idnum eq "") {
warn "Found no ".$set{'id'}." in english file!\n";
}