summaryrefslogtreecommitdiffstats
path: root/tools/genlang
diff options
context:
space:
mode:
authorNils Wallménius <nils@rockbox.org>2007-08-05 19:19:39 +0000
committerNils Wallménius <nils@rockbox.org>2007-08-05 19:19:39 +0000
commitb3113674819cd8daf44750d129c5d8298e830df0 (patch)
treeebc7ec9e096e309ef79834802eed28ff9c22fd41 /tools/genlang
parente70f7f4ca857e9e88a6e076360b6c9c235d7739b (diff)
downloadrockbox-b3113674819cd8daf44750d129c5d8298e830df0.tar.gz
rockbox-b3113674819cd8daf44750d129c5d8298e830df0.zip
*** Lang v2 cleanup (FS#6574) ***
1) Introduces apps/features.txt that controls which strings are included for each target based on defines. 2) .lng and .voice files are now target specific and the format versions of both these file types have been bumped, which means that new voice files are needed. 3) Use the 'features' mechanism to exclude strings for targets that didn't use them. 4) Delete unused and deprecated and duplicated strings, sort strings in english.lang Some string IDs were changed so translations will be slightly worse than before. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14198 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'tools/genlang')
-rwxr-xr-xtools/genlang18
1 files changed, 14 insertions, 4 deletions
diff --git a/tools/genlang b/tools/genlang
index 621ec37a58..aa7e090c35 100755
--- a/tools/genlang
+++ b/tools/genlang
@@ -11,7 +11,7 @@
#
# binary version for the binary lang file
-my $langversion = 3; # 3 was the latest one used in the v1 format
+my $langversion = 4; # 3 was the latest one used in the v1 format
# A note for future users and readers: The original v1 language system allowed
# the build to create and use a different language than english built-in. We
@@ -28,8 +28,8 @@ Usage: genlang [options] <langv2 file>
Make the tool create a [prefix].c and [prefix].h file.
-b=<outfile>
- Make the tool create a binary language (.lng) file namaed [outfile].
- The use of this option requires that you also use -e.
+ Make the tool create a binary language (.lng) file named [outfile].
+ The use of this option requires that you also use -e, -t and -i.
-u
Update language file. Given the translated file and the most recent english
@@ -48,6 +48,9 @@ Usage: genlang [options] <langv2 file>
separated with colons. This will make genlang to use all the specified
strings when searching for a matching phrase.
+ -i=<target id>
+ The target id number, needed for -b.
+
-o
Voice mode output. Outputs all id: and voice: lines for the given target!
@@ -88,11 +91,18 @@ if(!$check) {
print "Please use at least one of -p, -u, -o and -b\n";
exit;
}
+
if(($binary || $update || $voiceout) && !$english) {
print "Please use -e too when you use -b, -o or -u\n";
exit;
}
+my $target_id = $i;
+if($binary && !$target_id) {
+ print "Please specify a target id number (with -i)!\n";
+ exit;
+}
+
my $target = $t;
if(!$target && !$update) {
print "Please specify a target (with -t)!\n";
@@ -586,7 +596,7 @@ elsif($binary) {
open(OUTF, ">$binary") or die "Can't create $binary";
binmode OUTF;
- printf OUTF ("\x1a%c", $langversion); # magic lang file header
+ printf OUTF ("\x1a%c%c", $langversion, $target_id); # magic lang file header
# loop over the target phrases
for $i (1 .. $idcount) {