From b53c5bedf33d80e2a1720ecc0dbde7e95eb8d413 Mon Sep 17 00:00:00 2001 From: tilghman Date: Tue, 30 Jun 2009 18:44:16 +0000 Subject: Recorded merge of revisions 204470 via svnmerge from https://origsvn.digium.com/svn/asterisk/trunk ................ r204470 | tilghman | 2009-06-30 13:36:24 -0500 (Tue, 30 Jun 2009) | 18 lines Recorded merge of revisions 204469 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r204469 | tilghman | 2009-06-30 13:23:35 -0500 (Tue, 30 Jun 2009) | 11 lines "tw" is the language specification for Twi (from Ghana) not Taiwanese. (closes issue #15346) Reported by: volivier Patches: 20090617__issue15346__1.4.diff.txt uploaded by tilghman (license 14) 20090617__issue15346__trunk.diff.txt uploaded by tilghman (license 14) 20090617__issue15346__1.6.0.diff.txt uploaded by tilghman (license 14) 20090617__issue15346__1.6.1.diff.txt uploaded by tilghman (license 14) 20090617__issue15346__1.6.2.diff.txt uploaded by tilghman (license 14) Tested by: volivier ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@204471 f38db490-d61c-443f-a65b-d21fe96a405b --- UPGRADE.txt | 8 ++++++++ apps/app_voicemail.c | 20 ++++++++++---------- main/say.c | 49 ++++++++++++++++++++++++------------------------- 3 files changed, 42 insertions(+), 35 deletions(-) diff --git a/UPGRADE.txt b/UPGRADE.txt index 4878fe5b1..b61b88779 100644 --- a/UPGRADE.txt +++ b/UPGRADE.txt @@ -18,6 +18,14 @@ === =========================================================== +From 1.6.0.9 to 1.6.0.10: + +* 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. + From 1.6.0.1 to 1.6.0.2: * The ast_agi_register_multiple() and ast_agi_unregister_multiple() diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index 45739e43b..ade5ece56 100644 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -5869,7 +5869,7 @@ leave_vm_out: res = ast_say_date_with_format(chan, t, AST_DIGIT_ANY, chan->language, "'vm-received' q H 'digits/kai' M ", NULL); else if (!strcasecmp(chan->language, "pt_BR")) res = ast_say_date_with_format(chan, t, AST_DIGIT_ANY, chan->language, "'vm-received' Ad 'digits/pt-de' B 'digits/pt-de' Y 'digits/pt-as' HM ", NULL); - else if (!strcasecmp(chan->language, "tw")) /* CHINESE (Taiwan) syntax */ + else if (!strncasecmp(chan->language, "zh", 2)) /* CHINESE (Taiwan) syntax */ res = ast_say_date_with_format(chan, t, AST_DIGIT_ANY, chan->language, "qR 'vm-received'", NULL); else { res = ast_say_date_with_format(chan, t, AST_DIGIT_ANY, chan->language, "'vm-received' q 'digits/at' IMp", NULL); @@ -7114,7 +7114,7 @@ static int vm_intro_cz(struct ast_channel *chan, struct vm_state *vms) } /* CHINESE (Taiwan) syntax */ -static int vm_intro_tw(struct ast_channel *chan, struct vm_state *vms) +static int vm_intro_zh(struct ast_channel *chan, struct vm_state *vms) { int res; /* Introduce messages they have */ @@ -7193,8 +7193,8 @@ static int vm_intro(struct ast_channel *chan, struct ast_vm_user *vmu, struct vm return vm_intro_no(chan, vms); } else if (!strcasecmp(chan->language, "ru")) { /* RUSSIAN syntax */ return vm_intro_multilang(chan, vms, "n"); - } else if (!strcasecmp(chan->language, "tw")) { /* CHINESE (Taiwan) syntax */ - return vm_intro_tw(chan, vms); + } else if (!strncasecmp(chan->language, "zh", 2)) { /* CHINESE (Taiwan) syntax */ + return vm_intro_zh(chan, vms); } else if (!strcasecmp(chan->language, "ua")) { /* UKRAINIAN syntax */ return vm_intro_multilang(chan, vms, "n"); } else { /* Default to ENGLISH */ @@ -7249,7 +7249,7 @@ static int vm_instructions_en(struct ast_channel *chan, struct vm_state *vms, in return res; } -static int vm_instructions_tw(struct ast_channel *chan, struct vm_state *vms, int skipadvanced) +static int vm_instructions_zh(struct ast_channel *chan, struct vm_state *vms, int skipadvanced) { int res = 0; /* Play instructions and wait for new command */ @@ -7275,8 +7275,8 @@ static int vm_instructions_tw(struct ast_channel *chan, struct vm_state *vms, in static int vm_instructions(struct ast_channel *chan, struct vm_state *vms, int skipadvanced) { - if (vms->starting && !strcasecmp(chan->language, "tw")) { /* CHINESE (Taiwan) syntax */ - return vm_instructions_tw(chan, vms, skipadvanced); + if (vms->starting && !strncasecmp(chan->language, "zh", 2)) { /* CHINESE (Taiwan) syntax */ + return vm_instructions_zh(chan, vms, skipadvanced); } else { /* Default to ENGLISH */ return vm_instructions_en(chan, vms, skipadvanced); } @@ -7644,7 +7644,7 @@ static int vm_browse_messages_pt(struct ast_channel *chan, struct vm_state *vms, } /* Chinese (Taiwan)syntax */ -static int vm_browse_messages_tw(struct ast_channel *chan, struct vm_state *vms, struct ast_vm_user *vmu) +static int vm_browse_messages_zh(struct ast_channel *chan, struct vm_state *vms, struct ast_vm_user *vmu) { int cmd = 0; @@ -7674,8 +7674,8 @@ static int vm_browse_messages(struct ast_channel *chan, struct vm_state *vms, st return vm_browse_messages_pt(chan, vms, vmu); } else if (!strcasecmp(chan->language, "gr")) { return vm_browse_messages_gr(chan, vms, vmu); /* GREEK */ - } else if (!strcasecmp(chan->language, "tw")) { - return vm_browse_messages_tw(chan, vms, vmu); /* CHINESE (Taiwan) */ + } else if (!strncasecmp(chan->language, "zh", 2)) { + return vm_browse_messages_zh(chan, vms, vmu); /* CHINESE (Taiwan) */ } else { /* Default to English syntax */ return vm_browse_messages_en(chan, vms, vmu); } diff --git a/main/say.c b/main/say.c index d6722be3a..12a7846c9 100644 --- a/main/say.c +++ b/main/say.c @@ -343,7 +343,7 @@ static int ast_say_number_full_no(struct ast_channel *chan, int num, const char 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); @@ -379,7 +379,7 @@ static int ast_say_date_with_format_it(struct ast_channel *chan, time_t time, co 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_date_with_format_th(struct ast_channel *chan, time_t time, const char *ints, const char *lang, const char *format, const char *timezone); @@ -389,7 +389,7 @@ static int ast_say_time_fr(struct ast_channel *chan, time_t t, const char *ints, 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_hu(struct ast_channel *chan, time_t t, const char *ints, const char *lang); @@ -402,7 +402,7 @@ static int ast_say_datetime_fr(struct ast_channel *chan, time_t t, const char *i 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_hu(struct ast_channel *chan, time_t t, const char *ints, const char *lang); @@ -459,8 +459,8 @@ static int say_number_full(struct ast_channel *chan, int num, const char *ints, 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 */ @@ -2239,8 +2239,8 @@ static int ast_say_number_full_se(struct ast_channel *chan, int num, const char 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; @@ -2315,7 +2315,7 @@ static int ast_say_number_full_tw(struct ast_channel *chan, int num, const char 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); @@ -2325,7 +2325,7 @@ static int ast_say_number_full_tw(struct ast_channel *chan, int num, const char snprintf(fn, sizeof(fn), "digits/wan"); } else { if (num < 1000000000) { /* 1,000,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); @@ -3425,8 +3425,8 @@ static int say_date_with_format(struct ast_channel *chan, time_t time, const cha 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, "th") ) { /* Thai syntax */ return(ast_say_date_with_format_th(chan, time, ints, lang, format, timezone)); } else if (!strcasecmp(lang, "gr") ) { /* Greek syntax */ @@ -5743,7 +5743,7 @@ int ast_say_date_with_format_pt(struct ast_channel *chan, time_t time, const cha } /* 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 timeval tv = { time, 0 }; struct ast_tm tm; @@ -5935,7 +5935,7 @@ int ast_say_date_with_format_tw(struct ast_channel *chan, time_t time, const cha /* 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; @@ -5960,14 +5960,14 @@ int ast_say_date_with_format_tw(struct ast_channel *chan, time_t time, const cha 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 */ @@ -5990,7 +5990,7 @@ int ast_say_date_with_format_tw(struct ast_channel *chan, time_t time, const cha } 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 ' ': @@ -6024,9 +6024,8 @@ static int say_time(struct ast_channel *chan, time_t t, const char *ints, const 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") ) { /* Taiwanese syntax */ - } 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, "th") ) { @@ -6250,7 +6249,7 @@ int ast_say_time_th(struct ast_channel *chan, time_t t, const char *ints, const } /* 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 timeval tv = { t, 0 }; struct ast_tm tm; @@ -6342,8 +6341,8 @@ static int say_datetime(struct ast_channel *chan, time_t t, const char *ints, co 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, "th") ) { /* Thai syntax */ @@ -6639,7 +6638,7 @@ int ast_say_datetime_th(struct ast_channel *chan, time_t t, const char *ints, co } /* 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 timeval tv = { t, 0 }; struct ast_tm tm; -- cgit v1.2.3