From 92b80bdba589672b99820a90ad2624d89f555ef1 Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Mon, 22 May 2023 10:30:13 -0400 Subject: 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 --- tools/genlang | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tools/genlang') 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; my $VOICE_COOKIE = 0x9a; my $LANGUAGE_VERSION = 0x06; my $LANGUAGE_FLAG_RTL = 0x01; +my $LANGUAGE_FLAG_UNITS_FIRST = 0x02; my $HEADER_SIZE = 4; my $SUBHEADER_SIZE = 6; @@ -372,6 +373,9 @@ while() { if ($_ =~ /LANGUAGE_IS_RTL/) { $langoptions |= $LANGUAGE_FLAG_RTL; } + if ($_ =~ /LANGUAGE_UNITS_FIRST/) { + $langoptions |= $LANGUAGE_FLAG_UNITS_FIRST; + } if ($header and $sortfile) { print($_); -- cgit v1.2.3