Index: main/say.c =================================================================== --- main/say.c (revision 199741) +++ main/say.c (working copy) @@ -345,7 +345,7 @@ static int ast_say_number_full_pl(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_pt(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_se(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_tw(struct ast_channel *chan, int num, const char *ints, const char *language, int audiofd, int ctrlfd); +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); @@ -377,7 +377,7 @@ static int ast_say_date_with_format_nl(struct ast_channel *chan, time_t time, const char *ints, const char *lang, const char *format, const char *timezone); static int ast_say_date_with_format_pl(struct ast_channel *chan, time_t time, const char *ints, const char *lang, const char *format, const char *timezone); static int ast_say_date_with_format_pt(struct ast_channel *chan, time_t time, const char *ints, const char *lang, const char *format, const char *timezone); -static int ast_say_date_with_format_tw(struct ast_channel *chan, time_t time, const char *ints, const char *lang, const char *format, const char *timezone); +static int ast_say_date_with_format_zh(struct ast_channel *chan, time_t time, const char *ints, const char *lang, const char *format, const char *timezone); static int ast_say_date_with_format_gr(struct ast_channel *chan, time_t time, const char *ints, const char *lang, const char *format, const char *timezone); static int ast_say_time_en(struct ast_channel *chan, time_t t, const char *ints, const char *lang); @@ -386,7 +386,7 @@ static int ast_say_time_nl(struct ast_channel *chan, time_t t, const char *ints, const char *lang); static int ast_say_time_pt(struct ast_channel *chan, time_t t, const char *ints, const char *lang); 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_tw(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_he(struct ast_channel *chan, time_t t, const char *ints, const char *lang); @@ -397,7 +397,7 @@ static int ast_say_datetime_nl(struct ast_channel *chan, time_t t, const char *ints, const char *lang); static int ast_say_datetime_pt(struct ast_channel *chan, time_t t, const char *ints, const char *lang); 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_tw(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_he(struct ast_channel *chan, time_t t, const char *ints, const char *lang); @@ -450,8 +450,8 @@ 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 (!strcasecmp(language, "tw") || !strcasecmp(language, "zh") ) { /* Taiwanese / Chinese syntax */ - return(ast_say_number_full_tw(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 (!strcasecmp(language, "gr") ) { /* Greek syntax */ return(ast_say_number_full_gr(chan, num, ints, language, audiofd, ctrlfd)); } else if (!strcasecmp(language, "ru") ) { /* Russian syntax */ @@ -2147,8 +2147,8 @@ return res; } -/*! \brief ast_say_number_full_tw: Taiwanese / Chinese syntax */ -static int ast_say_number_full_tw(struct ast_channel *chan, int num, const char *ints, const char *language, int audiofd, int ctrlfd) +/*! \brief ast_say_number_full_zh: Taiwanese / Chinese syntax */ +static int ast_say_number_full_zh(struct ast_channel *chan, int num, const char *ints, const char *language, int audiofd, int ctrlfd) { int res = 0; int playh = 0; @@ -2223,7 +2223,7 @@ last_length = strlen(buf); num -= ((num / 1000) * 1000); } else if (num < 100000000) { /* 100,000,000 */ - res = ast_say_number_full_tw(chan, num / 10000, ints, language, audiofd, ctrlfd); + res = ast_say_number_full_zh(chan, num / 10000, ints, language, audiofd, ctrlfd); if (res) return res; snprintf(buf, 10, "%d", num); @@ -2233,7 +2233,7 @@ snprintf(fn, sizeof(fn), "digits/wan"); } else { if (num < 1000000000) { /* 1000,000,000 */ - res = ast_say_number_full_tw(chan, num / 100000000, ints, language, audiofd, ctrlfd); + res = ast_say_number_full_zh(chan, num / 100000000, ints, language, audiofd, ctrlfd); if (res) return res; snprintf(buf, 10, "%d", num); @@ -3186,8 +3186,8 @@ 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 (!strcasecmp(lang, "tw") || !strcasecmp(lang, "zh") ) { /* Taiwanese / Chinese syntax */ - return(ast_say_date_with_format_tw(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)); } @@ -5365,7 +5365,7 @@ } /* Taiwanese / Chinese syntax */ -int ast_say_date_with_format_tw(struct ast_channel *chan, time_t time, const char *ints, const char *lang, const char *format, const char *timezone) +int ast_say_date_with_format_zh(struct ast_channel *chan, time_t time, const char *ints, const char *lang, const char *format, const char *timezone) { struct tm tm; int res=0, offset, sndoffset; @@ -5558,7 +5558,7 @@ /* Yesterday */ res = wait_file(chan,ints, "digits/yesterday",lang); } else { - res = ast_say_date_with_format_tw(chan, time, ints, lang, "YBdA", timezone); + res = ast_say_date_with_format_zh(chan, time, ints, lang, "YBdA", timezone); } } break; @@ -5585,14 +5585,14 @@ res = wait_file(chan,ints, "digits/yesterday",lang); } else if (beg_today - 86400 * 6 < time) { /* Within the last week */ - res = ast_say_date_with_format_tw(chan, time, ints, lang, "A", timezone); + res = ast_say_date_with_format_zh(chan, time, ints, lang, "A", timezone); } else { - res = ast_say_date_with_format_tw(chan, time, ints, lang, "YBdA", timezone); + res = ast_say_date_with_format_zh(chan, time, ints, lang, "YBdA", timezone); } } break; case 'R': - res = ast_say_date_with_format_tw(chan, time, ints, lang, "kM", timezone); + res = ast_say_date_with_format_zh(chan, time, ints, lang, "kM", timezone); break; case 'S': /* Seconds */ @@ -5615,7 +5615,7 @@ } break; case 'T': - res = ast_say_date_with_format_tw(chan, time, ints, lang, "HMS", timezone); + res = ast_say_date_with_format_zh(chan, time, ints, lang, "HMS", timezone); break; case ' ': case ' ': @@ -5647,8 +5647,8 @@ 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 (!strcasecmp(lang, "tw") || !strcasecmp(lang, "zh") ) { /* Taiwanese / Chinese syntax */ - return(ast_say_time_tw(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 */ @@ -5823,7 +5823,7 @@ } /* Taiwanese / Chinese syntax */ -int ast_say_time_tw(struct ast_channel *chan, time_t t, const char *ints, const char *lang) +int ast_say_time_zh(struct ast_channel *chan, time_t t, const char *ints, const char *lang) { struct tm tm; int res = 0; @@ -5911,8 +5911,8 @@ 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 (!strcasecmp(lang, "tw") || !strcasecmp(lang, "zh") ) { /* Taiwanese / Chinese syntax */ - return(ast_say_datetime_tw(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 */ @@ -6143,7 +6143,7 @@ } /* Taiwanese / Chinese syntax */ -int ast_say_datetime_tw(struct ast_channel *chan, time_t t, const char *ints, const char *lang) +int ast_say_datetime_zh(struct ast_channel *chan, time_t t, const char *ints, const char *lang) { struct tm tm; char fn[256]; Index: UPGRADE.txt =================================================================== --- UPGRADE.txt (revision 199741) +++ UPGRADE.txt (working copy) @@ -106,6 +106,14 @@ if your dialplan relies on the ability to 'run off the end' of an extension and wait for a new extension without using WaitExten() to accomplish that, you will need set autofallthrough to 'no' in your extensions.conf file. + +Language Support: + +* Support for Taiwanese was incorrectly supported with the "tw" language code. + 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. Command Line Interface: