diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-06-30 20:23:51 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-06-30 20:23:51 +0000 |
commit | 249bc2175103b1db9ab22f1f5fd94adad6b5cac0 (patch) | |
tree | d790fcf38d99d8259426346c8d938f29903d50ac /main/say.c | |
parent | 4146b918ff13d7af2a5a55146d8fe2130bb01892 (diff) |
More incorrect language codes, plus ensuring that regionalizations use the specified language, and not English for grammar.
(closes issue #15022)
Reported by: greenfieldtech
Patches:
20090519__issue15022.diff.txt uploaded by tilghman (license 14)
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@204556 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/say.c')
-rw-r--r-- | main/say.c | 376 |
1 files changed, 188 insertions, 188 deletions
diff --git a/main/say.c b/main/say.c index 8e4715d79..d8a121895 100644 --- a/main/say.c +++ b/main/say.c @@ -291,9 +291,9 @@ static int say_digit_str_full(struct ast_channel *chan, const char *str, const c \arg \b pt - Portuguese \arg \b pt_BR - Portuguese (Brazil) \arg \b se - Swedish - \arg \b tw - Taiwanese / Chinese + \arg \b zh - Taiwanese / Chinese \arg \b ru - Russian - \arg \b ge - Georgian + \arg \b ka - Georgian \par Gender: For Some languages the numbers differ for gender and plural. @@ -332,7 +332,7 @@ static int say_digit_str_full(struct ast_channel *chan, const char *str, const c /* Forward declarations of language specific variants of ast_say_number_full */ static int ast_say_number_full_en(struct ast_channel *chan, int num, const char *ints, const char *language, int audiofd, int ctrlfd); -static int ast_say_number_full_cz(struct ast_channel *chan, int num, const char *ints, const char *language, const char *options, int audiofd, int ctrlfd); +static int ast_say_number_full_cs(struct ast_channel *chan, int num, const char *ints, const char *language, const char *options, int audiofd, int ctrlfd); static int ast_say_number_full_da(struct ast_channel *chan, int num, const char *ints, const char *language, const char *options, int audiofd, int ctrlfd); static int ast_say_number_full_de(struct ast_channel *chan, int num, const char *ints, const char *language, const char *options, int audiofd, int ctrlfd); static int ast_say_number_full_en_GB(struct ast_channel *chan, int num, const char *ints, const char *language, int audiofd, int ctrlfd); @@ -348,7 +348,7 @@ static int ast_say_number_full_se(struct ast_channel *chan, int num, const char static int ast_say_number_full_zh(struct ast_channel *chan, int num, const char *ints, const char *language, int audiofd, int ctrlfd); static int ast_say_number_full_gr(struct ast_channel *chan, int num, const char *ints, const char *language, int audiofd, int ctrlfd); static int ast_say_number_full_ru(struct ast_channel *chan, int num, const char *ints, const char *language, const char *options, int audiofd, int ctrlfd); -static int ast_say_number_full_ge(struct ast_channel *chan, int num, const char *ints, const char *language, const char *options, int audiofd, int ctrlfd); +static int ast_say_number_full_ka(struct ast_channel *chan, int num, const char *ints, const char *language, const char *options, int audiofd, int ctrlfd); /* Forward declarations of language specific variants of ast_say_enumeration_full */ static int ast_say_enumeration_full_en(struct ast_channel *chan, int num, const char *ints, const char *language, int audiofd, int ctrlfd); @@ -364,7 +364,7 @@ static int ast_say_date_fr(struct ast_channel *chan, time_t t, const char *ints, static int ast_say_date_nl(struct ast_channel *chan, time_t t, const char *ints, const char *lang); static int ast_say_date_pt(struct ast_channel *chan, time_t t, const char *ints, const char *lang); static int ast_say_date_gr(struct ast_channel *chan, time_t t, const char *ints, const char *lang); -static int ast_say_date_ge(struct ast_channel *chan, time_t t, const char *ints, const char *lang); +static int ast_say_date_ka(struct ast_channel *chan, time_t t, const char *ints, const char *lang); static int ast_say_date_he(struct ast_channel *chan, time_t t, const char *ints, const char *lang); static int ast_say_date_with_format_en(struct ast_channel *chan, time_t time, const char *ints, const char *lang, const char *format, const char *timezone); @@ -388,7 +388,7 @@ static int ast_say_time_pt(struct ast_channel *chan, time_t t, const char *ints, static int ast_say_time_pt_BR(struct ast_channel *chan, time_t t, const char *ints, const char *lang); static int ast_say_time_zh(struct ast_channel *chan, time_t t, const char *ints, const char *lang); static int ast_say_time_gr(struct ast_channel *chan, time_t t, const char *ints, const char *lang); -static int ast_say_time_ge(struct ast_channel *chan, time_t t, const char *ints, const char *lang); +static int ast_say_time_ka(struct ast_channel *chan, time_t t, const char *ints, const char *lang); static int ast_say_time_he(struct ast_channel *chan, time_t t, const char *ints, const char *lang); static int ast_say_datetime_en(struct ast_channel *chan, time_t t, const char *ints, const char *lang); @@ -399,13 +399,13 @@ static int ast_say_datetime_pt(struct ast_channel *chan, time_t t, const char *i static int ast_say_datetime_pt_BR(struct ast_channel *chan, time_t t, const char *ints, const char *lang); static int ast_say_datetime_zh(struct ast_channel *chan, time_t t, const char *ints, const char *lang); static int ast_say_datetime_gr(struct ast_channel *chan, time_t t, const char *ints, const char *lang); -static int ast_say_datetime_ge(struct ast_channel *chan, time_t t, const char *ints, const char *lang); +static int ast_say_datetime_ka(struct ast_channel *chan, time_t t, const char *ints, const char *lang); static int ast_say_datetime_he(struct ast_channel *chan, time_t t, const char *ints, const char *lang); static int ast_say_datetime_from_now_en(struct ast_channel *chan, time_t t, const char *ints, const char *lang); static int ast_say_datetime_from_now_fr(struct ast_channel *chan, time_t t, const char *ints, const char *lang); static int ast_say_datetime_from_now_pt(struct ast_channel *chan, time_t t, const char *ints, const char *lang); -static int ast_say_datetime_from_now_ge(struct ast_channel *chan, time_t t, const char *ints, const char *lang); +static int ast_say_datetime_from_now_ka(struct ast_channel *chan, time_t t, const char *ints, const char *lang); static int ast_say_datetime_from_now_he(struct ast_channel *chan, time_t t, const char *ints, const char *lang); static int wait_file(struct ast_channel *chan, const char *ints, const char *file, const char *lang) @@ -422,42 +422,42 @@ static int wait_file(struct ast_channel *chan, const char *ints, const char *fil /* Called from AGI */ static int say_number_full(struct ast_channel *chan, int num, const char *ints, const char *language, const char *options, int audiofd, int ctrlfd) { - if (!strcasecmp(language,"en") ) { /* English syntax */ - return(ast_say_number_full_en(chan, num, ints, language, audiofd, ctrlfd)); - } else if (!strcasecmp(language, "cz") ) { /* Czech syntax */ - return(ast_say_number_full_cz(chan, num, ints, language, options, audiofd, ctrlfd)); - } else if (!strcasecmp(language, "da") ) { /* Danish syntax */ - return(ast_say_number_full_da(chan, num, ints, language, options, audiofd, ctrlfd)); - } else if (!strcasecmp(language, "de") ) { /* German syntax */ - return(ast_say_number_full_de(chan, num, ints, language, options, audiofd, ctrlfd)); - } else if (!strcasecmp(language, "en_GB") ) { /* British syntax */ - return(ast_say_number_full_en_GB(chan, num, ints, language, audiofd, ctrlfd)); - } else if (!strcasecmp(language, "no") ) { /* Norwegian syntax */ - return(ast_say_number_full_no(chan, num, ints, language, options, audiofd, ctrlfd)); - } else if (!strcasecmp(language, "es") || !strcasecmp(language, "mx")) { /* Spanish syntax */ - return(ast_say_number_full_es(chan, num, ints, language, options, audiofd, ctrlfd)); - } else if (!strcasecmp(language, "fr") ) { /* French syntax */ - return(ast_say_number_full_fr(chan, num, ints, language, options, audiofd, ctrlfd)); - } else if (!strcasecmp(language, "he") ) { /* Hebrew syntax */ - return(ast_say_number_full_he(chan, num, ints, language, options, audiofd, ctrlfd)); - } else if (!strcasecmp(language, "it") ) { /* Italian syntax */ - return(ast_say_number_full_it(chan, num, ints, language, audiofd, ctrlfd)); - } else if (!strcasecmp(language, "nl") ) { /* Dutch syntax */ - return(ast_say_number_full_nl(chan, num, ints, language, audiofd, ctrlfd)); - } else if (!strcasecmp(language, "pl") ) { /* Polish syntax */ - return(ast_say_number_full_pl(chan, num, ints, language, options, audiofd, ctrlfd)); - } else if (!strcasecmp(language, "pt") || !strcasecmp(language, "pt_BR")) { /* Portuguese syntax */ - return(ast_say_number_full_pt(chan, num, ints, language, options, audiofd, ctrlfd)); - } else if (!strcasecmp(language, "se") ) { /* Swedish syntax */ - return(ast_say_number_full_se(chan, num, ints, language, options, audiofd, ctrlfd)); - } else if (!strncasecmp(language, "zh", 2) ) { /* Taiwanese / Chinese syntax */ - return(ast_say_number_full_zh(chan, num, ints, language, audiofd, ctrlfd)); - } else if (!strcasecmp(language, "gr") ) { /* Greek syntax */ - return(ast_say_number_full_gr(chan, num, ints, language, audiofd, ctrlfd)); - } else if (!strcasecmp(language, "ru") ) { /* Russian syntax */ - return(ast_say_number_full_ru(chan, num, ints, language, options, audiofd, ctrlfd)); - } else if (!strcasecmp(language, "ge") ) { /* Georgian syntax */ - return(ast_say_number_full_ge(chan, num, ints, language, options, audiofd, ctrlfd)); + if (!strncasecmp(language, "en_GB", 5)) { /* British syntax */ + return ast_say_number_full_en_GB(chan, num, ints, language, audiofd, ctrlfd); + } else if (!strncasecmp(language, "en", 2)) { /* English syntax */ + return ast_say_number_full_en(chan, num, ints, language, audiofd, ctrlfd); + } else if (!strncasecmp(language, "cs", 2)) { /* Czech syntax */ + return ast_say_number_full_cs(chan, num, ints, language, options, audiofd, ctrlfd); + } else if (!strncasecmp(language, "da", 2)) { /* Danish syntax */ + return ast_say_number_full_da(chan, num, ints, language, options, audiofd, ctrlfd); + } else if (!strncasecmp(language, "de", 2)) { /* German syntax */ + return ast_say_number_full_de(chan, num, ints, language, options, audiofd, ctrlfd); + } else if (!strncasecmp(language, "es", 2)) { /* Spanish syntax */ + return ast_say_number_full_es(chan, num, ints, language, options, audiofd, ctrlfd); + } else if (!strncasecmp(language, "fr", 2)) { /* French syntax */ + return ast_say_number_full_fr(chan, num, ints, language, options, audiofd, ctrlfd); + } else if (!strncasecmp(language, "gr", 2)) { /* Greek syntax */ + return ast_say_number_full_gr(chan, num, ints, language, audiofd, ctrlfd); + } else if (!strncasecmp(language, "he", 2)) { /* Hebrew syntax */ + return ast_say_number_full_he(chan, num, ints, language, options, audiofd, ctrlfd); + } else if (!strncasecmp(language, "it", 2)) { /* Italian syntax */ + return ast_say_number_full_it(chan, num, ints, language, audiofd, ctrlfd); + } else if (!strncasecmp(language, "ka", 2)) { /* Georgian syntax */ + return ast_say_number_full_ka(chan, num, ints, language, options, audiofd, ctrlfd); + } else if (!strncasecmp(language, "nl", 2)) { /* Dutch syntax */ + return ast_say_number_full_nl(chan, num, ints, language, audiofd, ctrlfd); + } else if (!strncasecmp(language, "no", 2)) { /* Norwegian syntax */ + return ast_say_number_full_no(chan, num, ints, language, options, audiofd, ctrlfd); + } else if (!strncasecmp(language, "pl", 2)) { /* Polish syntax */ + return ast_say_number_full_pl(chan, num, ints, language, options, audiofd, ctrlfd); + } else if (!strncasecmp(language, "pt", 2)) { /* Portuguese syntax */ + return ast_say_number_full_pt(chan, num, ints, language, options, audiofd, ctrlfd); + } else if (!strncasecmp(language, "ru", 2)) { /* Russian syntax */ + return ast_say_number_full_ru(chan, num, ints, language, options, audiofd, ctrlfd); + } else if (!strncasecmp(language, "se", 2)) { /* Swedish syntax */ + return ast_say_number_full_se(chan, num, ints, language, options, audiofd, ctrlfd); + } else if (!strncasecmp(language, "zh", 2)) { /* Taiwanese / Chinese syntax */ + return ast_say_number_full_zh(chan, num, ints, language, audiofd, ctrlfd); } /* Default to english */ @@ -538,7 +538,7 @@ static int exp10_int(int power) return res; } -/*! \brief ast_say_number_full_cz: Czech syntax */ +/*! \brief ast_say_number_full_cs: Czech syntax */ /* files needed: * 1m,2m - gender male * 1w,2w - gender female @@ -559,7 +559,7 @@ static int exp10_int(int power) * tousand, milion are gender male, so 1 and 2 is 1m 2m * miliard is gender female, so 1 and 2 is 1w 2w */ -static int ast_say_number_full_cz(struct ast_channel *chan, int num, const char *ints, const char *language, const char *options, int audiofd, int ctrlfd) +static int ast_say_number_full_cs(struct ast_channel *chan, int num, const char *ints, const char *language, const char *options, int audiofd, int ctrlfd) { int res = 0; int playh = 0; @@ -602,7 +602,7 @@ static int ast_say_number_full_cz(struct ast_channel *chan, int num, const char } else if ( hundered == 2 ) { snprintf(fn, sizeof(fn), "digits/2ste"); } else { - res = ast_say_number_full_cz(chan,hundered,ints,language,options,audiofd,ctrlfd); + res = ast_say_number_full_cs(chan,hundered,ints,language,options,audiofd,ctrlfd); if (res) return res; if (hundered == 3 || hundered == 4) { @@ -626,7 +626,7 @@ static int ast_say_number_full_cz(struct ast_channel *chan, int num, const char } } if ( left > 1 ) { /* we dont say "one thousand" but only thousand */ - res = ast_say_number_full_cz(chan,left,ints,language,options,audiofd,ctrlfd); + res = ast_say_number_full_cs(chan,left,ints,language,options,audiofd,ctrlfd); if (res) return res; } @@ -2368,18 +2368,18 @@ static int ast_say_number_full_ru(struct ast_channel *chan, int num, const char /* Called from AGI */ static int say_enumeration_full(struct ast_channel *chan, int num, const char *ints, const char *language, const char *options, int audiofd, int ctrlfd) { - if (!strcasecmp(language,"en") ) { /* English syntax */ - return(ast_say_enumeration_full_en(chan, num, ints, language, audiofd, ctrlfd)); - } else if (!strcasecmp(language, "da") ) { /* Danish syntax */ - return(ast_say_enumeration_full_da(chan, num, ints, language, options, audiofd, ctrlfd)); - } else if (!strcasecmp(language, "de") ) { /* German syntax */ - return(ast_say_enumeration_full_de(chan, num, ints, language, options, audiofd, ctrlfd)); - } else if (!strcasecmp(language, "he")) { /* Hebrew syntax */ - return (ast_say_enumeration_full_he(chan, num, ints, language, options, audiofd, ctrlfd)); - } - + if (!strncasecmp(language, "en", 2)) { /* English syntax */ + return ast_say_enumeration_full_en(chan, num, ints, language, audiofd, ctrlfd); + } else if (!strncasecmp(language, "da", 2)) { /* Danish syntax */ + return ast_say_enumeration_full_da(chan, num, ints, language, options, audiofd, ctrlfd); + } else if (!strncasecmp(language, "de", 2)) { /* German syntax */ + return ast_say_enumeration_full_de(chan, num, ints, language, options, audiofd, ctrlfd); + } else if (!strncasecmp(language, "he", 2)) { /* Hebrew syntax */ + return ast_say_enumeration_full_he(chan, num, ints, language, options, audiofd, ctrlfd); + } + /* Default to english */ - return(ast_say_enumeration_full_en(chan, num, ints, language, audiofd, ctrlfd)); + return ast_say_enumeration_full_en(chan, num, ints, language, audiofd, ctrlfd); } /*! \brief ast_say_enumeration_full_en: English syntax */ @@ -2897,28 +2897,28 @@ static int ast_say_enumeration_full_he(struct ast_channel *chan, int num, const static int say_date(struct ast_channel *chan, time_t t, const char *ints, const char *lang) { - if (!strcasecmp(lang, "en") ) { /* English syntax */ - return(ast_say_date_en(chan, t, ints, lang)); - } else if (!strcasecmp(lang, "da") ) { /* Danish syntax */ - return(ast_say_date_da(chan, t, ints, lang)); - } else if (!strcasecmp(lang, "de") ) { /* German syntax */ - return(ast_say_date_de(chan, t, ints, lang)); - } else if (!strcasecmp(lang, "fr") ) { /* French syntax */ - return(ast_say_date_fr(chan, t, ints, lang)); - } else if (!strcasecmp(lang, "nl") ) { /* Dutch syntax */ - return(ast_say_date_nl(chan, t, ints, lang)); - } else if (!strcasecmp(lang, "pt") || !strcasecmp(lang, "pt_BR")) { /* Portuguese syntax */ - return(ast_say_date_pt(chan, t, ints, lang)); - } else if (!strcasecmp(lang, "gr") ) { /* Greek syntax */ - return(ast_say_date_gr(chan, t, ints, lang)); - } else if (!strcasecmp(lang, "ge") ) { /* Georgian syntax */ - return(ast_say_date_ge(chan, t, ints, lang)); - } else if (!strcasecmp(lang, "he")) { /* Hebrew syntax */ - return (ast_say_date_he(chan, t, ints, lang)); + if (!strncasecmp(lang, "en", 2)) { /* English syntax */ + return ast_say_date_en(chan, t, ints, lang); + } else if (!strncasecmp(lang, "da", 2)) { /* Danish syntax */ + return ast_say_date_da(chan, t, ints, lang); + } else if (!strncasecmp(lang, "de", 2)) { /* German syntax */ + return ast_say_date_de(chan, t, ints, lang); + } else if (!strncasecmp(lang, "fr", 2)) { /* French syntax */ + return ast_say_date_fr(chan, t, ints, lang); + } else if (!strncasecmp(lang, "gr", 2)) { /* Greek syntax */ + return ast_say_date_gr(chan, t, ints, lang); + } else if (!strncasecmp(lang, "he", 2)) { /* Hebrew syntax */ + return ast_say_date_he(chan, t, ints, lang); + } else if (!strncasecmp(lang, "ka", 2)) { /* Georgian syntax */ + return ast_say_date_ka(chan, t, ints, lang); + } else if (!strncasecmp(lang, "nl", 2)) { /* Dutch syntax */ + return ast_say_date_nl(chan, t, ints, lang); + } else if (!strncasecmp(lang, "pt", 2)) { /* Portuguese syntax */ + return ast_say_date_pt(chan, t, ints, lang); } /* Default to English */ - return(ast_say_date_en(chan, t, ints, lang)); + return ast_say_date_en(chan, t, ints, lang); } /* English syntax */ @@ -3163,34 +3163,34 @@ int ast_say_date_he(struct ast_channel *chan, time_t t, const char *ints, const static int say_date_with_format(struct ast_channel *chan, time_t time, const char *ints, const char *lang, const char *format, const char *timezone) { - if (!strcasecmp(lang, "en") ) { /* English syntax */ - return(ast_say_date_with_format_en(chan, time, ints, lang, format, timezone)); - } else if (!strcasecmp(lang, "da") ) { /* Danish syntax */ - return(ast_say_date_with_format_da(chan, time, ints, lang, format, timezone)); - } else if (!strcasecmp(lang, "de") ) { /* German syntax */ - return(ast_say_date_with_format_de(chan, time, ints, lang, format, timezone)); - } else if (!strcasecmp(lang, "es") || !strcasecmp(lang, "mx")) { /* Spanish syntax */ - return (ast_say_date_with_format_es(chan, time, ints, lang, format, timezone)); - } else if (!strcasecmp(lang, "he")) { /* Hebrew syntax */ - return (ast_say_date_with_format_he(chan, time, ints, lang, format, timezone)); - } else if (!strcasecmp(lang, "fr")) { /* French syntax */ - return (ast_say_date_with_format_fr(chan, time, ints, lang, format, timezone)); - } else if (!strcasecmp(lang, "it")) { /* Italian syntax */ - return (ast_say_date_with_format_it(chan, time, ints, lang, format, timezone)); - } else if (!strcasecmp(lang, "nl")) { /* Dutch syntax */ - return (ast_say_date_with_format_nl(chan, time, ints, lang, format, timezone)); - } else if (!strcasecmp(lang, "pl")) { /* Polish syntax */ - return (ast_say_date_with_format_pl(chan, time, ints, lang, format, timezone)); - } else if (!strcasecmp(lang, "pt") || !strcasecmp(lang, "pt_BR")) { /* Portuguese syntax */ - return(ast_say_date_with_format_pt(chan, time, ints, lang, format, timezone)); - } else if (!strncasecmp(lang, "zh", 2) ) { /* Taiwanese / Chinese syntax */ - return(ast_say_date_with_format_zh(chan, time, ints, lang, format, timezone)); - } else if (!strcasecmp(lang, "gr") ) { /* Greek syntax */ - return(ast_say_date_with_format_gr(chan, time, ints, lang, format, timezone)); + if (!strncasecmp(lang, "en", 2)) { /* English syntax */ + return ast_say_date_with_format_en(chan, time, ints, lang, format, timezone); + } else if (!strncasecmp(lang, "da", 2)) { /* Danish syntax */ + return ast_say_date_with_format_da(chan, time, ints, lang, format, timezone); + } else if (!strncasecmp(lang, "de", 2)) { /* German syntax */ + return ast_say_date_with_format_de(chan, time, ints, lang, format, timezone); + } else if (!strncasecmp(lang, "es", 2)) { /* Spanish syntax */ + return ast_say_date_with_format_es(chan, time, ints, lang, format, timezone); + } else if (!strncasecmp(lang, "he", 2)) { /* Hebrew syntax */ + return ast_say_date_with_format_he(chan, time, ints, lang, format, timezone); + } else if (!strncasecmp(lang, "fr", 2)) { /* French syntax */ + return ast_say_date_with_format_fr(chan, time, ints, lang, format, timezone); + } else if (!strncasecmp(lang, "gr", 2)) { /* Greek syntax */ + return ast_say_date_with_format_gr(chan, time, ints, lang, format, timezone); + } else if (!strncasecmp(lang, "it", 2)) { /* Italian syntax */ + return ast_say_date_with_format_it(chan, time, ints, lang, format, timezone); + } else if (!strncasecmp(lang, "nl", 2)) { /* Dutch syntax */ + return ast_say_date_with_format_nl(chan, time, ints, lang, format, timezone); + } else if (!strncasecmp(lang, "pl", 2)) { /* Polish syntax */ + return ast_say_date_with_format_pl(chan, time, ints, lang, format, timezone); + } else if (!strncasecmp(lang, "pt", 2)) { /* Portuguese syntax */ + return ast_say_date_with_format_pt(chan, time, ints, lang, format, timezone); + } else if (!strncasecmp(lang, "zh", 2)) { /* Taiwanese / Chinese syntax */ + return ast_say_date_with_format_zh(chan, time, ints, lang, format, timezone); } /* Default to English */ - return(ast_say_date_with_format_en(chan, time, ints, lang, format, timezone)); + return ast_say_date_with_format_en(chan, time, ints, lang, format, timezone); } /* English syntax */ @@ -5632,30 +5632,30 @@ int ast_say_date_with_format_zh(struct ast_channel *chan, time_t time, const cha static int say_time(struct ast_channel *chan, time_t t, const char *ints, const char *lang) { - if (!strcasecmp(lang, "en") ) { /* English syntax */ - return(ast_say_time_en(chan, t, ints, lang)); - } else if (!strcasecmp(lang, "de") ) { /* German syntax */ - return(ast_say_time_de(chan, t, ints, lang)); - } else if (!strcasecmp(lang, "fr") ) { /* French syntax */ - return(ast_say_time_fr(chan, t, ints, lang)); - } else if (!strcasecmp(lang, "nl") ) { /* Dutch syntax */ - return(ast_say_time_nl(chan, t, ints, lang)); - } else if (!strcasecmp(lang, "pt") ) { /* Portuguese syntax */ - return(ast_say_time_pt(chan, t, ints, lang)); - } else if (!strcasecmp(lang, "pt_BR") ) { /* Brazilian Portuguese syntax */ - return(ast_say_time_pt_BR(chan, t, ints, lang)); - } else if (!strncasecmp(lang, "zh", 2) ) { /* Taiwanese / Chinese syntax */ - return(ast_say_time_zh(chan, t, ints, lang)); - } else if (!strcasecmp(lang, "gr") ) { /* Greek syntax */ - return(ast_say_time_gr(chan, t, ints, lang)); - } else if (!strcasecmp(lang, "ge") ) { /* Georgian syntax */ - return(ast_say_time_ge(chan, t, ints, lang)); - } else if (!strcasecmp(lang, "he")) { /* Hebrew syntax */ - return (ast_say_time_he(chan, t, ints, lang)); + if (!strncasecmp(lang, "en", 2)) { /* English syntax */ + return ast_say_time_en(chan, t, ints, lang); + } else if (!strncasecmp(lang, "de", 2)) { /* German syntax */ + return ast_say_time_de(chan, t, ints, lang); + } else if (!strncasecmp(lang, "fr", 2)) { /* French syntax */ + return ast_say_time_fr(chan, t, ints, lang); + } else if (!strncasecmp(lang, "gr", 2)) { /* Greek syntax */ + return ast_say_time_gr(chan, t, ints, lang); + } else if (!strncasecmp(lang, "he", 2)) { /* Hebrew syntax */ + return ast_say_time_he(chan, t, ints, lang); + } else if (!strncasecmp(lang, "ka", 2)) { /* Georgian syntax */ + return ast_say_time_ka(chan, t, ints, lang); + } else if (!strncasecmp(lang, "nl", 2)) { /* Dutch syntax */ + return ast_say_time_nl(chan, t, ints, lang); + } else if (!strncasecmp(lang, "pt_BR", 5)) { /* Brazilian Portuguese syntax */ + return ast_say_time_pt_BR(chan, t, ints, lang); + } else if (!strncasecmp(lang, "pt", 2)) { /* Portuguese syntax */ + return ast_say_time_pt(chan, t, ints, lang); + } else if (!strncasecmp(lang, "zh", 2)) { /* Taiwanese / Chinese syntax */ + return ast_say_time_zh(chan, t, ints, lang); } /* Default to English */ - return(ast_say_time_en(chan, t, ints, lang)); + return ast_say_time_en(chan, t, ints, lang); } /* English syntax */ @@ -5896,30 +5896,30 @@ int ast_say_time_he(struct ast_channel *chan, time_t t, const char *ints, const } static int say_datetime(struct ast_channel *chan, time_t t, const char *ints, const char *lang) { - if (!strcasecmp(lang, "en") ) { /* English syntax */ - return(ast_say_datetime_en(chan, t, ints, lang)); - } else if (!strcasecmp(lang, "de") ) { /* German syntax */ - return(ast_say_datetime_de(chan, t, ints, lang)); - } else if (!strcasecmp(lang, "fr") ) { /* French syntax */ - return(ast_say_datetime_fr(chan, t, ints, lang)); - } else if (!strcasecmp(lang, "nl") ) { /* Dutch syntax */ - return(ast_say_datetime_nl(chan, t, ints, lang)); - } else if (!strcasecmp(lang, "pt") ) { /* Portuguese syntax */ - return(ast_say_datetime_pt(chan, t, ints, lang)); - } else if (!strcasecmp(lang, "pt_BR") ) { /* Brazilian Portuguese syntax */ - return(ast_say_datetime_pt_BR(chan, t, ints, lang)); - } else if (!strncasecmp(lang, "zh", 2) ) { /* Taiwanese / Chinese syntax */ - return(ast_say_datetime_zh(chan, t, ints, lang)); - } else if (!strcasecmp(lang, "gr") ) { /* Greek syntax */ - return(ast_say_datetime_gr(chan, t, ints, lang)); - } else if (!strcasecmp(lang, "ge") ) { /* Georgian syntax */ - return(ast_say_datetime_ge(chan, t, ints, lang)); - } else if (!strcasecmp(lang, "he")) { /* Hebrew syntax */ - return (ast_say_datetime_he(chan, t, ints, lang)); + if (!strncasecmp(lang, "en", 2)) { /* English syntax */ + return ast_say_datetime_en(chan, t, ints, lang); + } else if (!strncasecmp(lang, "de", 2)) { /* German syntax */ + return ast_say_datetime_de(chan, t, ints, lang); + } else if (!strncasecmp(lang, "fr", 2)) { /* French syntax */ + return ast_say_datetime_fr(chan, t, ints, lang); + } else if (!strncasecmp(lang, "gr", 2)) { /* Greek syntax */ + return ast_say_datetime_gr(chan, t, ints, lang); + } else if (!strncasecmp(lang, "he", 2)) { /* Hebrew syntax */ + return ast_say_datetime_he(chan, t, ints, lang); + } else if (!strncasecmp(lang, "ka", 2)) { /* Georgian syntax */ + return ast_say_datetime_ka(chan, t, ints, lang); + } else if (!strncasecmp(lang, "nl", 2)) { /* Dutch syntax */ + return ast_say_datetime_nl(chan, t, ints, lang); + } else if (!strncasecmp(lang, "pt_BR", 5)) { /* Brazilian Portuguese syntax */ + return ast_say_datetime_pt_BR(chan, t, ints, lang); + } else if (!strncasecmp(lang, "pt", 2)) { /* Portuguese syntax */ + return ast_say_datetime_pt(chan, t, ints, lang); + } else if (!strncasecmp(lang, "zh", 2)) { /* Taiwanese / Chinese syntax */ + return ast_say_datetime_zh(chan, t, ints, lang); } /* Default to English */ - return(ast_say_datetime_en(chan, t, ints, lang)); + return ast_say_datetime_en(chan, t, ints, lang); } /* English syntax */ @@ -6264,20 +6264,20 @@ int ast_say_datetime_he(struct ast_channel *chan, time_t t, const char *ints, co } static int say_datetime_from_now(struct ast_channel *chan, time_t t, const char *ints, const char *lang) { - if (!strcasecmp(lang, "en") ) { /* English syntax */ - return(ast_say_datetime_from_now_en(chan, t, ints, lang)); - } else if (!strcasecmp(lang, "fr") ) { /* French syntax */ - return(ast_say_datetime_from_now_fr(chan, t, ints, lang)); - } else if (!strcasecmp(lang, "pt") || !strcasecmp(lang, "pt_BR")) { /* Portuguese syntax */ - return(ast_say_datetime_from_now_pt(chan, t, ints, lang)); - } else if (!strcasecmp(lang, "ge") ) { /* Georgian syntax */ - return(ast_say_datetime_from_now_ge(chan, t, ints, lang)); - } else if (!strcasecmp(lang, "he")) { /* Georgian syntax */ - return (ast_say_datetime_from_now_he(chan, t, ints, lang)); + if (!strncasecmp(lang, "en", 2)) { /* English syntax */ + return ast_say_datetime_from_now_en(chan, t, ints, lang); + } else if (!strncasecmp(lang, "fr", 2)) { /* French syntax */ + return ast_say_datetime_from_now_fr(chan, t, ints, lang); + } else if (!strncasecmp(lang, "he", 2)) { /* Hebrew syntax */ + return ast_say_datetime_from_now_he(chan, t, ints, lang); + } else if (!strncasecmp(lang, "ka", 2)) { /* Georgian syntax */ + return ast_say_datetime_from_now_ka(chan, t, ints, lang); + } else if (!strncasecmp(lang, "pt", 2)) { /* Portuguese syntax */ + return ast_say_datetime_from_now_pt(chan, t, ints, lang); } /* Default to English */ - return(ast_say_datetime_from_now_en(chan, t, ints, lang)); + return ast_say_datetime_from_now_en(chan, t, ints, lang); } /* English syntax */ @@ -6909,7 +6909,7 @@ static int ast_say_date_with_format_gr(struct ast_channel *chan, time_t time, co To be able to play the sounds, each of the above tokens needs a corresponding sound file. (e.g. 200_.gsm). */ -static char* ast_translate_number_ge(int num, char* res, int res_len) +static char* ast_translate_number_ka(int num, char* res, int res_len) { char buf[256]; int digit = 0; @@ -6936,22 +6936,22 @@ static char* ast_translate_number_ge(int num, char* res, int res_len) if (num < 40) { /* ocda... */ strncat(res, "20_ ", res_len - strlen(res) - 1); - return ast_translate_number_ge(num - 20, res, res_len); + return ast_translate_number_ka(num - 20, res, res_len); } if (num < 60) { /* ormocda... */ strncat(res, "40_ ", res_len - strlen(res) - 1); - return ast_translate_number_ge(num - 40, res, res_len); + return ast_translate_number_ka(num - 40, res, res_len); } if (num < 80) { /* samocda... */ strncat(res, "60_ ", res_len - strlen(res) - 1); - return ast_translate_number_ge(num - 60, res, res_len); + return ast_translate_number_ka(num - 60, res, res_len); } if (num < 100) { /* otxmocda... */ strncat(res, "80_ ", res_len - strlen(res) - 1); - return ast_translate_number_ge(num - 80, res, res_len); + return ast_translate_number_ka(num - 80, res, res_len); } @@ -6966,7 +6966,7 @@ static char* ast_translate_number_ge(int num, char* res, int res_len) } else { snprintf(buf, sizeof(buf), "%d_ ", digit*100); strncat(res, buf, res_len - strlen(res) - 1); - return ast_translate_number_ge(remainder, res, res_len); + return ast_translate_number_ka(remainder, res, res_len); } } @@ -6982,19 +6982,19 @@ static char* ast_translate_number_ge(int num, char* res, int res_len) digit = (num - remainder) / 1000; if (remainder == 0) { - ast_translate_number_ge(digit, res, res_len); + ast_translate_number_ka(digit, res, res_len); strncat(res, " 1000", res_len - strlen(res) - 1); return res; } if (digit == 1) { strncat(res, "1000_ ", res_len - strlen(res) - 1); - return ast_translate_number_ge(remainder, res, res_len); + return ast_translate_number_ka(remainder, res, res_len); } - ast_translate_number_ge(digit, res, res_len); + ast_translate_number_ka(digit, res, res_len); strncat(res, " 1000_ ", res_len - strlen(res) - 1); - return ast_translate_number_ge(remainder, res, res_len); + return ast_translate_number_ka(remainder, res, res_len); } @@ -7010,14 +7010,14 @@ static char* ast_translate_number_ge(int num, char* res, int res_len) digit = (num - remainder) / 1000000; if (remainder == 0) { - ast_translate_number_ge(digit, res, res_len); + ast_translate_number_ka(digit, res, res_len); strncat(res, " 1000000", res_len - strlen(res) - 1); return res; } - ast_translate_number_ge(digit, res, res_len); + ast_translate_number_ka(digit, res, res_len); strncat(res, " 1000000_ ", res_len - strlen(res) - 1); - return ast_translate_number_ge(remainder, res, res_len); + return ast_translate_number_ka(remainder, res, res_len); } @@ -7033,14 +7033,14 @@ static char* ast_translate_number_ge(int num, char* res, int res_len) digit = (num - remainder) / 1000000000; if (remainder == 0) { - ast_translate_number_ge(digit, res, res_len); + ast_translate_number_ka(digit, res, res_len); strncat(res, " 1000000000", res_len - strlen(res) - 1); return res; } - ast_translate_number_ge(digit, res, res_len); + ast_translate_number_ka(digit, res, res_len); strncat(res, " 1000000000_ ", res_len - strlen(res) - 1); - return ast_translate_number_ge(remainder, res, res_len); + return ast_translate_number_ka(remainder, res, res_len); } @@ -7050,8 +7050,8 @@ static char* ast_translate_number_ge(int num, char* res, int res_len) -/*! \brief ast_say_number_full_ge: Georgian syntax */ -static int ast_say_number_full_ge(struct ast_channel *chan, int num, const char *ints, const char *language, const char *options, int audiofd, int ctrlfd) +/*! \brief ast_say_number_full_ka: Georgian syntax */ +static int ast_say_number_full_ka(struct ast_channel *chan, int num, const char *ints, const char *language, const char *options, int audiofd, int ctrlfd) { int res = 0; char fn[512] = ""; @@ -7062,7 +7062,7 @@ static int ast_say_number_full_ge(struct ast_channel *chan, int num, const char return ast_say_digits_full(chan, 0, ints, language, audiofd, ctrlfd); - ast_translate_number_ge(num, fn, 512); + ast_translate_number_ka(num, fn, 512); @@ -7128,7 +7128,7 @@ tslis /* Georgian syntax. e.g. "oriatas xuti tslis 5 noemberi". */ -static int ast_say_date_ge(struct ast_channel *chan, time_t t, const char *ints, const char *lang) +static int ast_say_date_ka(struct ast_channel *chan, time_t t, const char *ints, const char *lang) { struct tm tm; char fn[256]; @@ -7167,7 +7167,7 @@ static int ast_say_date_ge(struct ast_channel *chan, time_t t, const char *ints, /* Georgian syntax. e.g. "otxi saati da eqvsi tsuti" */ -static int ast_say_time_ge(struct ast_channel *chan, time_t t, const char *ints, const char *lang) +static int ast_say_time_ka(struct ast_channel *chan, time_t t, const char *ints, const char *lang) { struct tm tm; int res = 0; @@ -7198,7 +7198,7 @@ static int ast_say_time_ge(struct ast_channel *chan, time_t t, const char *ints, /* Georgian syntax. Say date, then say time. */ -static int ast_say_datetime_ge(struct ast_channel *chan, time_t t, const char *ints, const char *lang) +static int ast_say_datetime_ka(struct ast_channel *chan, time_t t, const char *ints, const char *lang) { struct tm tm; int res = 0; @@ -7215,7 +7215,7 @@ static int ast_say_datetime_ge(struct ast_channel *chan, time_t t, const char *i /* Georgian syntax */ -static int ast_say_datetime_from_now_ge(struct ast_channel *chan, time_t t, const char *ints, const char *lang) +static int ast_say_datetime_from_now_ka(struct ast_channel *chan, time_t t, const char *ints, const char *lang) { int res=0; time_t nowt; @@ -7307,13 +7307,13 @@ int ast_say_counted_noun(struct ast_channel *chan, int num, const char noun[]) char *temp; int temp_len; const char *ending; - if (!strcasecmp(chan->language, "ru")) { /* Russian */ + if (!strncasecmp(chan->language, "ru", 2)) { /* Russian */ ending = counted_noun_ending_slavic(num); - } else if(!strcasecmp(chan->language, "ua")) { /* Ukrainian */ + } else if (!strncasecmp(chan->language, "ua", 2)) { /* Ukrainian */ ending = counted_noun_ending_slavic(num); - } else if(!strcasecmp(chan->language, "pl")) { /* Polish */ + } else if (!strncasecmp(chan->language, "pl", 2)) { /* Polish */ ending = counted_noun_ending_slavic(num); - } else { /* English and default */ + } else { /* English and default */ ending = counted_noun_ending_en(num); } temp = alloca((temp_len = (strlen(noun) + strlen(ending) + 1))); @@ -7330,7 +7330,7 @@ int ast_say_counted_noun(struct ast_channel *chan, int num, const char noun[]) */ static const char *counted_adjective_ending_ru(int num, const char gender[]) { - if (num < 0) { + if (num < 0) { num *= -1; } num %= 100; /* never pay attention to more than two digits */ @@ -7349,13 +7349,13 @@ int ast_say_counted_adjective(struct ast_channel *chan, int num, const char adje char *temp; int temp_len; const char *ending; - if (!strcasecmp(chan->language, "ru")) { /* Russian */ + if (!strncasecmp(chan->language, "ru", 2)) { /* Russian */ ending = counted_adjective_ending_ru(num, gender); - } else if (!strcasecmp(chan->language, "ua")) { /* Ukrainian */ + } else if (!strncasecmp(chan->language, "ua", 2)) { /* Ukrainian */ ending = counted_adjective_ending_ru(num, gender); - } else if (!strcasecmp(chan->language, "pl")) { /* Polish */ + } else if (!strncasecmp(chan->language, "pl", 2)) { /* Polish */ ending = counted_adjective_ending_ru(num, gender); - } else { /* English and default */ + } else { /* English and default */ ending = ""; } temp = alloca((temp_len = (strlen(adjective) + strlen(ending) + 1))); |