summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/lang/dansk.lang14
-rw-r--r--apps/lang/english-us.lang14
-rw-r--r--apps/lang/english.lang14
-rw-r--r--apps/talk.c45
-rwxr-xr-xtools/updatelang14
5 files changed, 86 insertions, 15 deletions
diff --git a/apps/lang/dansk.lang b/apps/lang/dansk.lang
index 536ecb28ec..aff651cc52 100644
--- a/apps/lang/dansk.lang
+++ b/apps/lang/dansk.lang
@@ -12652,3 +12652,17 @@
*: "Start auto-sluk ved opstart"
</voice>
</phrase>
+<phrase>
+ id: VOICE_NUMERIC_TENS_SWAP_SEPARATOR
+ desc: voice only, for speaking numbers in languages that swap the tens and ones fields. Leave blank for languages that do not need it, such as English ("231" => "two hundred thirty one") but other languages may speak it as "two hundred one [AND] thirty"
+ user: core
+ <source>
+ *: ""
+ </source>
+ <dest>
+ *: ""
+ </dest>
+ <voice>
+ *: "og"
+ </voice>
+</phrase>
diff --git a/apps/lang/english-us.lang b/apps/lang/english-us.lang
index 14b33569d2..b926b4e37e 100644
--- a/apps/lang/english-us.lang
+++ b/apps/lang/english-us.lang
@@ -16013,3 +16013,17 @@
*: "Bit rate"
</voice>
</phrase>
+<phrase>
+ id: VOICE_NUMERIC_TENS_SWAP_SEPARATOR
+ desc: voice only, for speaking numbers in languages that swap the tens and ones fields. Leave blank for languages that do not need it, such as English ("231" => "two hundred thirty one") but other languages may speak it as "two hundred one [AND] thirty"
+ user: core
+ <source>
+ *: ""
+ </source>
+ <dest>
+ *: ""
+ </dest>
+ <voice>
+ *: ""
+ </voice>
+</phrase>
diff --git a/apps/lang/english.lang b/apps/lang/english.lang
index 67624aa2a3..60cb17d245 100644
--- a/apps/lang/english.lang
+++ b/apps/lang/english.lang
@@ -16080,3 +16080,17 @@
*: "Bit rate"
</voice>
</phrase>
+<phrase>
+ id: VOICE_NUMERIC_TENS_SWAP_SEPARATOR
+ desc: voice only, for speaking numbers in languages that swap the tens and ones fields. Leave blank for languages that do not need it, such as English ("231" => "two hundred thirty one") but other languages may speak it as "two hundred one [AND] thirty"
+ user: core
+ <source>
+ *: ""
+ </source>
+ <dest>
+ *: ""
+ </dest>
+ <voice>
+ *: ""
+ </voice>
+</phrase>
diff --git a/apps/talk.c b/apps/talk.c
index 73191c22c3..e627337162 100644
--- a/apps/talk.c
+++ b/apps/talk.c
@@ -1188,17 +1188,44 @@ int talk_number(long n, bool enqueue)
talk_id(VOICE_HUNDRED, true);
}
- /* combination indexing */
- if (ones > 20)
+ struct queue_entry tens_swap;
+ if (get_clip(VOICE_NUMERIC_TENS_SWAP_SEPARATOR, &tens_swap) >= 0)
{
- int tens = ones/10 + 18;
- talk_id(VOICE_ZERO + tens, true);
- ones %= 10;
+ /* direct indexing */
+ if (ones <= 20)
+ {
+ talk_id(VOICE_ZERO + ones, true);
+ }
+ else if (ones)
+ {
+ int tmp = ones % 10;
+ if (tmp)
+ {
+ talk_id(VOICE_ZERO + tmp, true);
+ talk_id(VOICE_NUMERIC_TENS_SWAP_SEPARATOR, true);
+ }
+ }
+ /* combination indexing */
+ if (ones > 20)
+ {
+ int tens = ones/10 + 18;
+ talk_id(VOICE_ZERO + tens, true);
+ }
}
+ else
+ {
+ /* combination indexing */
+ if (ones > 20)
+ {
+ int tens = ones/10 + 18;
+ talk_id(VOICE_ZERO + tens, true);
+ ones %= 10;
+ }
- /* direct indexing */
- if (ones)
- talk_id(VOICE_ZERO + ones, true);
+ /* direct indexing */
+ if (ones)
+ talk_id(VOICE_ZERO + ones, true);
+ }
/* add billion, million, thousand */
if (mil)
@@ -1215,7 +1242,7 @@ int talk_number(long n, bool enqueue)
static int talk_year(long year, bool enqueue)
{
int rem;
- if(year < 1100 || year >=2000)
+ if(year < 1100 || (year >=2000 && year < 2100))
/* just say it as a regular number */
return talk_number(year, enqueue);
/* Say century */
diff --git a/tools/updatelang b/tools/updatelang
index 48f447d074..bde1dedaea 100755
--- a/tools/updatelang
+++ b/tools/updatelang
@@ -370,12 +370,14 @@ foreach my $id (@langorder) {
# print "#!! '$id:$tgt' voice is blank ('$lp{$tgt}' vs '$ep{$tgt}')\n";
$lang{$id}{'voice'}{$tgt} = $english{$id}{'voice'}{$tgt};
} elsif ($lp{$tgt} ne '' && $ep{$tgt} eq '') {
- # If it's not blank, clear it and complain!
- $lang{$id}{'notes'} .= "### The <voice> section for '$id:$tgt' is not blank!\n";
- $lang{$id}{'notes'} .= "### the previously used one is commented below:\n";
- $lang{$id}{'notes'} .= "### $english{$id}{voice}{$tgt}\n";
-# print "#!! '$id:$tgt' voice not blank ('$lp{$tgt}' vs '$ep{$tgt}')\n";
- $lang{$id}{'voice'}{$tgt} = $english{$id}{'voice'}{$tgt};
+ if ($id ne 'VOICE_NUMERIC_TENS_SWAP_SEPARATOR') {
+ # If it's not blank, clear it and complain!
+ $lang{$id}{'notes'} .= "### The <voice> section for '$id:$tgt' is not blank!\n";
+ $lang{$id}{'notes'} .= "### the previously used one is commented below:\n";
+ $lang{$id}{'notes'} .= "### $english{$id}{voice}{$tgt}\n";
+ # print "#!! '$id:$tgt' voice not blank ('$lp{$tgt}' vs '$ep{$tgt}')\n";
+ $lang{$id}{'voice'}{$tgt} = $english{$id}{'voice'}{$tgt};
+ }
}
} elsif ($lp{$tgt} ne 'none' && $lp{$tgt} ne '' && not_ignorelist($id) && !$lang{$id}{'new'} && !$ignoredups) {
$lang{$id}{'notes'} .= "### The <voice> section for '$id:$tgt' is identical to english!\n";