summaryrefslogtreecommitdiff
path: root/tools
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 /tools
parentbf8c3056f94e2a7951d0e53d247f8d3b2aca2d84 (diff)
downloadrockbox-9a4a5e98345aa825fcaf1fc3529d0e672b2978de.tar.gz
rockbox-9a4a5e98345aa825fcaf1fc3529d0e672b2978de.zip
Now correctly generates language files, ignoring voice entries
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4532 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'tools')
-rwxr-xr-xtools/binlang33
1 files changed, 19 insertions, 14 deletions
diff --git a/tools/binlang b/tools/binlang
index 64e9a8576a..83824e38b3 100755
--- a/tools/binlang
+++ b/tools/binlang
@@ -64,10 +64,21 @@ while(<ENG>) {
64 ($var, $value) = ($1, $2); 64 ($var, $value) = ($1, $2);
65 $set{$var} = $value; 65 $set{$var} = $value;
66 66
67 # "new" is always the last one, so now we have them all
67 if($var eq "new") { 68 if($var eq "new") {
68 # the last one for a single phrase 69 $value = $set{'eng'};
69 $idnum{$set{'id'}}=$idnum; 70
70 $idnum++; 71 if($value =~ s/^\"(.*)\"\s*$/$1/g) {
72 # Skip voice-only entries
73 if(!$value && $set{'voice'}) {
74 $idnum{$set{'id'}} = '_done_';
75 next;
76 }
77
78 # Assign an ID number to this entry
79 $idnum{$set{'id'}}=$idnum;
80 $idnum++;
81 }
71 undef %set; 82 undef %set;
72 } 83 }
73 } 84 }
@@ -83,12 +94,15 @@ while(<LANG>) {
83 $_ =~ s/\r//g; 94 $_ =~ s/\r//g;
84 if($_ =~ /^ *([a-z]+): *(.*)/) { 95 if($_ =~ /^ *([a-z]+): *(.*)/) {
85 ($var, $value) = ($1, $2); 96 ($var, $value) = ($1, $2);
86 # print "$var => $value\n";
87 97
88 $set{$var} = $value; 98 $set{$var} = $value;
89 99
100 # "new" is always the last one, so now we have them all
90 if($var eq "new") { 101 if($var eq "new") {
91 # the last one for a single phrase 102 $idnum = $idnum{$set{'id'}};
103
104 # Skip already processed entries (like voice-only ones)
105 next if($idnum eq '_done_');
92 106
93 if(!$value) { 107 if(!$value) {
94 # if not set, get the english version 108 # if not set, get the english version
@@ -96,15 +110,6 @@ while(<LANG>) {
96 } 110 }
97 111
98 if($value =~ s/^\"(.*)\"\s*$/$1/g) { 112 if($value =~ s/^\"(.*)\"\s*$/$1/g) {
99
100 # Skip voice-only entries
101 if(!$value && $set{'voice'}) {
102 $idnum{$set{'id'}} = '_done_';
103 next;
104 }
105
106 $idnum = $idnum{$set{'id'}};
107
108 if($idnum eq "") { 113 if($idnum eq "") {
109 warn "Found no ".$set{'id'}." in english file!\n"; 114 warn "Found no ".$set{'id'}." in english file!\n";
110 } 115 }