summaryrefslogtreecommitdiff
path: root/tools/genlang
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2023-05-22 10:30:13 -0400
committerSolomon Peachy <pizza@shaftnet.org>2023-05-22 10:30:13 -0400
commit92b80bdba589672b99820a90ad2624d89f555ef1 (patch)
treeaa36f69c7f54a941cfb2d1638f0f04daced99e61 /tools/genlang
parentab0ba139f50a9c9b3eadbe1c15d44ce88cf980d3 (diff)
downloadrockbox-92b80bdba589672b99820a90ad2624d89f555ef1.tar.gz
rockbox-92b80bdba589672b99820a90ad2624d89f555ef1.zip
lang: Support languages that speak the units before a numerical value
Previously, it was hardcoded to the english convention of units-last, so "100%" would be voiced as "one hundred percent". This adds a new language flag that makes the units be voiced first, ie "100%" will be voiced as "percent one hundred". So far only the Chinese-traditional and Chinese-simplified languages utilize this feature (taken from an old ticket, FS#10340) but I'm sure others would want this feature too. Change-Id: Idf825ec9299dc0ed09921cf67aec61b1ab262fc6
Diffstat (limited to 'tools/genlang')
-rwxr-xr-xtools/genlang4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/genlang b/tools/genlang
index 4f7386890d..abff3e8e18 100755
--- a/tools/genlang
+++ b/tools/genlang
@@ -16,6 +16,7 @@ my $LANGUAGE_COOKIE = 0x1a;
16my $VOICE_COOKIE = 0x9a; 16my $VOICE_COOKIE = 0x9a;
17my $LANGUAGE_VERSION = 0x06; 17my $LANGUAGE_VERSION = 0x06;
18my $LANGUAGE_FLAG_RTL = 0x01; 18my $LANGUAGE_FLAG_RTL = 0x01;
19my $LANGUAGE_FLAG_UNITS_FIRST = 0x02;
19 20
20my $HEADER_SIZE = 4; 21my $HEADER_SIZE = 4;
21my $SUBHEADER_SIZE = 6; 22my $SUBHEADER_SIZE = 6;
@@ -372,6 +373,9 @@ while(<LANG>) {
372 if ($_ =~ /LANGUAGE_IS_RTL/) { 373 if ($_ =~ /LANGUAGE_IS_RTL/) {
373 $langoptions |= $LANGUAGE_FLAG_RTL; 374 $langoptions |= $LANGUAGE_FLAG_RTL;
374 } 375 }
376 if ($_ =~ /LANGUAGE_UNITS_FIRST/) {
377 $langoptions |= $LANGUAGE_FLAG_UNITS_FIRST;
378 }
375 379
376 if ($header and $sortfile) { 380 if ($header and $sortfile) {
377 print($_); 381 print($_);