[Home]

Summary:ASTERISK-07057: [patch] Say number needs correct grammar for British English
Reporter:Tony Howat (tonyh)Labels:
Date Opened:2006-05-30 11:31:31Date Closed:2011-06-07 14:07:29
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:Here's a quick patch for 1.2.7.1's say.c (original file being say_us.c)
which corrects the spoken grammar of the "say number" application for
British english to include "and" before the tens and units of numbers
greater than 100. It's minor but I've done this in response to complaints
from UK customers.

I couldn't submit this to the tree without potentially causing issues as "US
English" is currently the default with the identifier "en", whereas I
believe US English should be "en-us" and British English should be "en" (en
is defined as no specified variant, so it would seem sensible to have it as
the root language). Not keen on starting another round of the civil war I'll
leave you guys to decide what to do.

I would suggest an en-gb context is an appropriate compromise - this patch works directly on the root en context at present.

Provide this context and I'll look for and patch more localisation issues for the UK.


****** ADDITIONAL INFORMATION ******

--- say.c       2006-05-30 17:27:07.000000000 +0100
+++ say_us.c    2006-05-29 12:25:02.000000000 +0100
@@ -465,16 +465,7 @@
{
       int res = 0;
       int playh = 0;
-        int and = 0;
       char fn[256] = "";
-
-        /* British English grammar includes "and" before the tens/units portion in
-         * any number greater than 100, tony@i-r-genius.com
-         */
-
-        if (abs(num) > 100)
-           and=1;
-
       if (!num)
               return ast_say_digits_full(chan, 0,ints, language, audiofd, ctrlfd);

@@ -489,9 +480,6 @@
               } else if (playh) {
                       snprintf(fn, sizeof(fn), "digits/hundred");
                       playh = 0;
-               } else if (and && (num < 100)) {
-                        snprintf(fn, sizeof(fn), "and");
-                        and = 0;
                } else if (num < 20) {
                       snprintf(fn, sizeof(fn), "digits/%d", num);
                       num = 0;
Comments:By: Tilghman Lesher (tilghman) 2006-05-30 12:28:24

No change needed, as noted on the list, as this is already in trunk, as en_GB