[asterisk-commits] tilghman: trunk r204563 - in /trunk: ./ UPGRADE.txt main/say.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Jun 30 15:41:10 CDT 2009
Author: tilghman
Date: Tue Jun 30 15:41:04 2009
New Revision: 204563
URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=204563
Log:
Merged revisions 204556 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r204556 | tilghman | 2009-06-30 15:23:51 -0500 (Tue, 30 Jun 2009) | 6 lines
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)
........
Modified:
trunk/ (props changed)
trunk/UPGRADE.txt
trunk/main/say.c
Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.
Modified: trunk/UPGRADE.txt
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/UPGRADE.txt?view=diff&rev=204563&r1=204562&r2=204563
==============================================================================
--- trunk/UPGRADE.txt (original)
+++ trunk/UPGRADE.txt Tue Jun 30 15:41:04 2009
@@ -50,7 +50,9 @@
In reality, the "tw" language code is reserved for the Twi language, native
to Ghana. If you were previously using the "tw" language code, you should
switch to using either "zh" (for Mandarin Chinese) or "zh_TW" for Taiwan
- specific localizations.
+ specific localizations. Additionally, "mx" should be changed to "es_MX",
+ Georgian was incorrectly specified as "ge" but should be "ka", and Czech is
+ "cs", not "cz".
From 1.6.0.1 to 1.6.1:
Modified: trunk/main/say.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/main/say.c?view=diff&rev=204563&r1=204562&r2=204563
==============================================================================
--- trunk/main/say.c (original)
+++ trunk/main/say.c Tue Jun 30 15:41:04 2009
@@ -288,9 +288,9 @@
\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
\arg \b hu - Hungarian
\par Gender:
@@ -330,7 +330,7 @@
/* 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);
@@ -346,7 +346,7 @@
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);
static int ast_say_number_full_hu(struct ast_channel *chan, int num, const char *ints, const char *language, int audiofd, int ctrlfd);
static int ast_say_number_full_th(struct ast_channel *chan, int num, const char *ints, const char *language, int audiofd, int ctrlfd);
static int ast_say_number_full_ur(struct ast_channel *chan, int num, const char *ints, const char *language, const char *options, int audiofd, int ctrlfd);
@@ -365,7 +365,7 @@
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_hu(struct ast_channel *chan, time_t t, const char *ints, const char *lang);
static int ast_say_date_th(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);
@@ -392,7 +392,7 @@
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_hu(struct ast_channel *chan, time_t t, const char *ints, const char *lang);
static int ast_say_time_th(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);
@@ -405,7 +405,7 @@
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_hu(struct ast_channel *chan, time_t t, const char *ints, const char *lang);
static int ast_say_datetime_th(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);
@@ -413,7 +413,7 @@
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)
@@ -430,52 +430,52 @@
/* 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, "hu") ) { /* Hungarian syntax */
- return(ast_say_number_full_hu(chan, num, ints, language, 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, "th") ) { /* Thai syntax */
- return(ast_say_number_full_th(chan, num, ints, language, audiofd, ctrlfd));
- } else if (!strcasecmp(language, "ur") ) { /* Urdu syntax */
- return(ast_say_number_full_ur(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, "hu", 2)) { /* Hungarian syntax */
+ return ast_say_number_full_hu(chan, num, ints, language, 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, "th", 2)) { /* Thai syntax */
+ return ast_say_number_full_th(chan, num, ints, language, 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 (!strncasecmp(language, "ur", 2)) { /* Urdu syntax */
+ return ast_say_number_full_ur(chan, num, ints, language, options, audiofd, ctrlfd);
}
/* Default to english */
- return(ast_say_number_full_en(chan, num, ints, language, audiofd, ctrlfd));
+ return ast_say_number_full_en(chan, num, ints, language, audiofd, ctrlfd);
}
/*! \brief ast_say_number_full_en: English syntax */
@@ -552,7 +552,7 @@
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
@@ -573,7 +573,7 @@
* 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;
@@ -616,7 +616,7 @@
} else if ( hundered == 2 ) {
ast_copy_string(fn, "digits/2ste", sizeof(fn));
} 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) {
@@ -640,7 +640,7 @@
}
}
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;
}
@@ -2280,10 +2280,7 @@
playz++;
continue;
}
- if (strcasecmp(language,"twz") == 0)
- snprintf(fn, sizeof(fn), "digits/%d", num);
- else
- snprintf(fn, sizeof(fn), "digits/%d", num);
+ snprintf(fn, sizeof(fn), "digits/%d", num);
num = 0;
} else if (num < 100) {
snprintf(buf, 10, "%d", num);
@@ -2595,18 +2592,18 @@
/* 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 */
@@ -3124,32 +3121,32 @@
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, "hu") ) { /* Hungarian syntax */
- return(ast_say_date_hu(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, "th") ) { /* Thai syntax */
- return(ast_say_date_th(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, "hu", 2)) { /* Hungarian syntax */
+ return ast_say_date_hu(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);
+ } else if (!strncasecmp(lang, "th", 2)) { /* Thai syntax */
+ return ast_say_date_th(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 */
@@ -3469,36 +3466,36 @@
static int say_date_with_format(struct ast_channel *chan, time_t t, const char *ints, const char *lang, const char *format, const char *tzone)
{
- if (!strcasecmp(lang, "en") ) { /* English syntax */
- return (ast_say_date_with_format_en(chan, t, ints, lang, format, tzone));
- } else if (!strcasecmp(lang, "da") ) { /* Danish syntax */
- return(ast_say_date_with_format_da(chan, t, ints, lang, format, tzone));
- } else if (!strcasecmp(lang, "de") ) { /* German syntax */
- return(ast_say_date_with_format_de(chan, t, ints, lang, format, tzone));
- } else if (!strcasecmp(lang, "es") || !strcasecmp(lang, "mx")) { /* Spanish syntax */
- return (ast_say_date_with_format_es(chan, t, ints, lang, format, tzone));
- } else if (!strcasecmp(lang, "he")) { /* Hebrew syntax */
- return (ast_say_date_with_format_he(chan, t, ints, lang, format, tzone));
- } else if (!strcasecmp(lang, "fr")) { /* French syntax */
- return (ast_say_date_with_format_fr(chan, t, ints, lang, format, tzone));
- } else if (!strcasecmp(lang, "it")) { /* Italian syntax */
- return (ast_say_date_with_format_it(chan, t, ints, lang, format, tzone));
- } else if (!strcasecmp(lang, "nl")) { /* Dutch syntax */
- return (ast_say_date_with_format_nl(chan, t, ints, lang, format, tzone));
- } else if (!strcasecmp(lang, "pl")) { /* Polish syntax */
- return (ast_say_date_with_format_pl(chan, t, ints, lang, format, tzone));
- } else if (!strcasecmp(lang, "pt") || !strcasecmp(lang, "pt_BR")) { /* Portuguese syntax */
- return (ast_say_date_with_format_pt(chan, t, ints, lang, format, tzone));
- } else if (!strncasecmp(lang, "zh", 2) ) { /* Taiwanese / Chinese syntax */
- return (ast_say_date_with_format_zh(chan, t, ints, lang, format, tzone));
- } else if (!strcasecmp(lang, "th") ) { /* Thai syntax */
- return (ast_say_date_with_format_th(chan, t, ints, lang, format, tzone));
- } else if (!strcasecmp(lang, "gr") ) { /* Greek syntax */
- return (ast_say_date_with_format_gr(chan, t, ints, lang, format, tzone));
+ if (!strncasecmp(lang, "en", 2)) { /* English syntax */
+ return ast_say_date_with_format_en(chan, t, ints, lang, format, tzone);
+ } else if (!strncasecmp(lang, "da", 2)) { /* Danish syntax */
+ return ast_say_date_with_format_da(chan, t, ints, lang, format, tzone);
+ } else if (!strncasecmp(lang, "de", 2)) { /* German syntax */
+ return ast_say_date_with_format_de(chan, t, ints, lang, format, tzone);
+ } else if (!strncasecmp(lang, "es", 2)) { /* Spanish syntax */
+ return ast_say_date_with_format_es(chan, t, ints, lang, format, tzone);
+ } else if (!strncasecmp(lang, "he", 2)) { /* Hebrew syntax */
+ return ast_say_date_with_format_he(chan, t, ints, lang, format, tzone);
+ } else if (!strncasecmp(lang, "fr", 2)) { /* French syntax */
+ return ast_say_date_with_format_fr(chan, t, ints, lang, format, tzone);
+ } else if (!strncasecmp(lang, "gr", 2)) { /* Greek syntax */
+ return ast_say_date_with_format_gr(chan, t, ints, lang, format, tzone);
+ } else if (!strncasecmp(lang, "it", 2)) { /* Italian syntax */
+ return ast_say_date_with_format_it(chan, t, ints, lang, format, tzone);
+ } else if (!strncasecmp(lang, "nl", 2)) { /* Dutch syntax */
+ return ast_say_date_with_format_nl(chan, t, ints, lang, format, tzone);
+ } else if (!strncasecmp(lang, "pl", 2)) { /* Polish syntax */
+ return ast_say_date_with_format_pl(chan, t, ints, lang, format, tzone);
+ } else if (!strncasecmp(lang, "pt", 2)) { /* Portuguese syntax */
+ return ast_say_date_with_format_pt(chan, t, ints, lang, format, tzone);
+ } else if (!strncasecmp(lang, "th", 2)) { /* Thai syntax */
+ return ast_say_date_with_format_th(chan, t, ints, lang, format, tzone);
+ } else if (!strncasecmp(lang, "zh", 2)) { /* Taiwanese / Chinese syntax */
+ return ast_say_date_with_format_zh(chan, t, ints, lang, format, tzone);
}
/* Default to English */
- return(ast_say_date_with_format_en(chan, t, ints, lang, format, tzone));
+ return ast_say_date_with_format_en(chan, t, ints, lang, format, tzone);
}
/* English syntax */
@@ -6074,34 +6071,34 @@
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, "hu") ) { /* Hungarian syntax */
+ 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, "hu", 2)) { /* Hungarian syntax */
return(ast_say_time_hu(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, "th") ) {
+ } 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, "th", 2)) { /* Thai syntax */
return(ast_say_time_th(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));
+ } 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 */
@@ -6391,34 +6388,34 @@
}
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, "hu") ) { /* Hungarian syntax */
- return(ast_say_datetime_hu(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, "th") ) { /* Thai syntax */
- return(ast_say_datetime_th(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, "hu", 2)) { /* Hungarian syntax */
+ return ast_say_datetime_hu(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, "th", 2)) { /* Thai syntax */
+ return ast_say_datetime_th(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 */
@@ -6828,20 +6825,20 @@
}
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 */
@@ -7463,7 +7460,7 @@
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;
@@ -7490,22 +7487,22 @@
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);
}
@@ -7520,7 +7517,7 @@
} else {
snprintf(buf, sizeof(buf), "%d_ ", digit*100);
strncat(res, buf, res_len - strlen(res) - 1);
- return ast_translate_number_ge(remaining, res, res_len);
+ return ast_translate_number_ka(remaining, res, res_len);
}
}
@@ -7536,20 +7533,19 @@
digit = (num - remaining) / 1000;
if (remaining == 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(remaining, res, res_len);
- }
-
- ast_translate_number_ge(digit, res, res_len);
+ return ast_translate_number_ka(remaining, res, res_len);
+ }
+
+ ast_translate_number_ka(digit, res, res_len);
strncat(res, " 1000_ ", res_len - strlen(res) - 1);
- return ast_translate_number_ge(remaining, res, res_len);
-
+ return ast_translate_number_ka(remaining, res, res_len);
}
@@ -7564,15 +7560,14 @@
digit = (num - remaining) / 1000000;
if (remaining == 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(remaining, res, res_len);
-
+ return ast_translate_number_ka(remaining, res, res_len);
}
@@ -7587,25 +7582,24 @@
digit = (num - remaining) / 1000000000;
if (remaining == 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(remaining, res, res_len);
-
- }
-
- return res;
-
-}
-
-
-
-/*! \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)
+ return ast_translate_number_ka(remaining, res, res_len);
+ }
+
+ return res;
+
+}
+
+
+
+/*! \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] = "";
@@ -7616,7 +7610,7 @@
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);
@@ -7682,7 +7676,7 @@
/* 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 timeval when = { t, 0 };
struct ast_tm tm;
@@ -7722,7 +7716,7 @@
/* 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 timeval when = { t, 0 };
struct ast_tm tm;
@@ -7754,7 +7748,7 @@
/* 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 timeval when = { t, 0 };
struct ast_tm tm;
@@ -7772,7 +7766,7 @@
/* 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;
int daydiff;
@@ -7862,13 +7856,13 @@
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)));
@@ -7885,7 +7879,7 @@
*/
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 */
@@ -7904,13 +7898,13 @@
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)));
More information about the asterisk-commits
mailing list