diff options
author | Solomon Peachy <pizza@shaftnet.org> | 2023-05-22 10:30:13 -0400 |
---|---|---|
committer | Solomon Peachy <pizza@shaftnet.org> | 2023-05-22 10:30:13 -0400 |
commit | 92b80bdba589672b99820a90ad2624d89f555ef1 (patch) | |
tree | aa36f69c7f54a941cfb2d1638f0f04daced99e61 /apps/talk.c | |
parent | ab0ba139f50a9c9b3eadbe1c15d44ce88cf980d3 (diff) | |
download | rockbox-92b80bdba5.tar.gz rockbox-92b80bdba5.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 'apps/talk.c')
-rw-r--r-- | apps/talk.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/apps/talk.c b/apps/talk.c index 2ef7fea84d..5d6e7ac0b6 100644 --- a/apps/talk.c +++ b/apps/talk.c @@ -35,6 +35,7 @@ #include "voice_thread.h" #include "audio.h" #include "lang.h" +#include "language.h" #include "talk.h" #include "metadata.h" /*#define LOGF_ENABLE*/ @@ -1419,8 +1420,11 @@ int talk_value_decimal(long n, int unit, int decimals, bool enqueue) return 0; } + if (lang_units_first()) + talk_id(unit_id, true); /* say the unit, if any */ talk_number(n, enqueue); /* say the number */ - talk_id(unit_id, true); /* say the unit, if any */ + if (!lang_units_first()) + talk_id(unit_id, true); /* say the unit, if any */ return 0; } |