diff options
-rwxr-xr-x | tools/binlang | 33 |
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 | } |