summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2004-04-21 06:39:52 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2004-04-21 06:39:52 +0000
commit9a4a5e98345aa825fcaf1fc3529d0e672b2978de (patch)
treecc19965fcb8c0db93bfc3c86b99e29acc052955a
parentbf8c3056f94e2a7951d0e53d247f8d3b2aca2d84 (diff)
downloadrockbox-9a4a5e98345aa825fcaf1fc3529d0e672b2978de.zip
rockbox-9a4a5e98345aa825fcaf1fc3529d0e672b2978de.tar.gz
rockbox-9a4a5e98345aa825fcaf1fc3529d0e672b2978de.tar.bz2
rockbox-9a4a5e98345aa825fcaf1fc3529d0e672b2978de.tar.xz
Now correctly generates language files, ignoring voice entries
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4532 a1c6a512-1295-4272-9138-f99709370657
-rwxr-xr-xtools/binlang33
1 files changed, 19 insertions, 14 deletions
diff --git a/tools/binlang b/tools/binlang
index 64e9a85..83824e3 100755
--- a/tools/binlang
+++ b/tools/binlang
@@ -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
- $idnum{$set{'id'}}=$idnum;
- $idnum++;
+ $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";
}