]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Removes improper use of sound 'and' in German language mode from application saynumber
authorJonathan Rose <jrose@digium.com>
Tue, 4 Oct 2011 19:33:12 +0000 (19:33 +0000)
committerJonathan Rose <jrose@digium.com>
Tue, 4 Oct 2011 19:33:12 +0000 (19:33 +0000)
Asterisk would say 'Five hundert und sechs und zwanzig' instead of 'Five hundert sechs
und zwanzig'... which is both weird sounding and wrong.  This patch makes sure Asterisk
will only say the 'and' word between the single digit and double digit places.

(closes issue ASTERISK-18212)
Reported By: Lionel Elie Mamane
Patches:
upstream_germand_no_and.diff (License #5402) uploaded by Lionel Elie Mamane

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@339352 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/say.c

index 7217bc9a6db3adab1abc25f94cc2a79f1429c14c..e5225287485117b2748ec079ad2e801ac6a69af2 100644 (file)
@@ -835,6 +835,9 @@ static int ast_say_number_full_de(struct ast_channel *chan, int num, const char
                * - 1000 is 'tausend', however all other instances are 'ein tausend'
                * - 1000000 is always 'eine million'
                * - "million" is different in singular and plural form
+               * - 'and' should not go between a hundreds place value and any
+               *   tens/ones place values that follows it. i.e 136 is ein hundert
+               *   sechs und dreizig, not ein hundert und sechs und dreizig.
                */
                if (num < 0) {
                        ast_copy_string(fn, "digits/minus", sizeof(fn));
@@ -842,10 +845,7 @@ static int ast_say_number_full_de(struct ast_channel *chan, int num, const char
                                num = -num;
                        } else {
                                num = 0;
-                       }       
-               } else if (num < 100 && t) {
-                       ast_copy_string(fn, "digits/and", sizeof(fn));
-                       t = 0;
+                       }
                } else if (num == 1 && mf == -1) {
                        snprintf(fn, sizeof(fn), "digits/%dF", num);
                        num = 0;
@@ -873,7 +873,6 @@ static int ast_say_number_full_de(struct ast_channel *chan, int num, const char
                                snprintf(fn, sizeof(fn), "digits/%d", hundreds);
                        }
                        ast_copy_string(fna, "digits/hundred", sizeof(fna));
-                       t = 1;
                } else if (num == 1000 && t == 0) {
                        ast_copy_string(fn, "digits/thousand", sizeof(fn));
                        num = 0;