summaryrefslogtreecommitdiff
path: root/apps/talk.c
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 /apps/talk.c
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 'apps/talk.c')
-rw-r--r--apps/talk.c6
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 @@
35#include "voice_thread.h" 35#include "voice_thread.h"
36#include "audio.h" 36#include "audio.h"
37#include "lang.h" 37#include "lang.h"
38#include "language.h"
38#include "talk.h" 39#include "talk.h"
39#include "metadata.h" 40#include "metadata.h"
40/*#define LOGF_ENABLE*/ 41/*#define LOGF_ENABLE*/
@@ -1419,8 +1420,11 @@ int talk_value_decimal(long n, int unit, int decimals, bool enqueue)
1419 return 0; 1420 return 0;
1420 } 1421 }
1421 1422
1423 if (lang_units_first())
1424 talk_id(unit_id, true); /* say the unit, if any */
1422 talk_number(n, enqueue); /* say the number */ 1425 talk_number(n, enqueue); /* say the number */
1423 talk_id(unit_id, true); /* say the unit, if any */ 1426 if (!lang_units_first())
1427 talk_id(unit_id, true); /* say the unit, if any */
1424 1428
1425 return 0; 1429 return 0;
1426} 1430}