[svn-commits] tilghman: trunk r204470 - in /trunk: ./ apps/ main/
SVN commits to the Digium repositories
svn-commits at lists.digium.com
Tue Jun 30 13:36:28 CDT 2009
Author: tilghman
Date: Tue Jun 30 13:36:24 2009
New Revision: 204470
URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=204470
Log:
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
........
Modified:
trunk/ (props changed)
trunk/UPGRADE.txt
trunk/apps/app_voicemail.c
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=204470&r1=204469&r2=204470
==============================================================================
--- trunk/UPGRADE.txt (original)
+++ trunk/UPGRADE.txt Tue Jun 30 13:36:24 2009
@@ -45,6 +45,12 @@
enough that most of it has been moved into the Asterisk core.
Two applications previously provided by res_indications, PlayTones and
StopPlayTones, have been moved into a new module, app_playtones.
+
+* 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.1:
@@ -135,3 +141,4 @@
func_sprintf, and is no longer included in func_strings. If you use this
function and do not use 'autoload=yes' in modules.conf, you will need
to explicitly load func_sprintf for it to be available.
+
Modified: trunk/apps/app_voicemail.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/apps/app_voicemail.c?view=diff&rev=204470&r1=204469&r2=204470
==============================================================================
--- trunk/apps/app_voicemail.c (original)
+++ trunk/apps/app_voicemail.c Tue Jun 30 13:36:24 2009
@@ -6806,7 +6806,7 @@
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);
@@ -8163,7 +8163,7 @@
}
/* 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 */
@@ -8242,8 +8242,8 @@
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 if (!strcasecmp(chan->language, "he")) { /* HEBREW syntax */
@@ -8333,7 +8333,7 @@
return res;
}
-static int vm_instructions_tw(struct ast_channel *chan, struct ast_vm_user *vmu, struct vm_state *vms, int skipadvanced, int in_urgent)
+static int vm_instructions_zh(struct ast_channel *chan, struct ast_vm_user *vmu, struct vm_state *vms, int skipadvanced, int in_urgent)
{
int res = 0;
/* Play instructions and wait for new command */
@@ -8359,8 +8359,8 @@
static int vm_instructions(struct ast_channel *chan, struct ast_vm_user *vmu, struct vm_state *vms, int skipadvanced, int in_urgent)
{
- if (vms->starting && !strcasecmp(chan->language, "tw")) { /* CHINESE (Taiwan) syntax */
- return vm_instructions_tw(chan, vmu, vms, skipadvanced, in_urgent);
+ if (vms->starting && !strncasecmp(chan->language, "zh", 2)) { /* CHINESE (Taiwan) syntax */
+ return vm_instructions_zh(chan, vmu, vms, skipadvanced, in_urgent);
} else { /* Default to ENGLISH */
return vm_instructions_en(chan, vmu, vms, skipadvanced, in_urgent);
}
@@ -8814,7 +8814,7 @@
*
* \return zero on success, -1 on error.
*/
-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;
@@ -8855,8 +8855,8 @@
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 if (!strcasecmp(chan->language, "he")) {
return vm_browse_messages_he(chan, vms, vmu); /* HEBREW */
} else { /* Default to English syntax */
Modified: trunk/main/say.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/main/say.c?view=diff&rev=204470&r1=204469&r2=204470
==============================================================================
--- trunk/main/say.c (original)
+++ trunk/main/say.c Tue Jun 30 13:36:24 2009
@@ -343,7 +343,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);
@@ -380,7 +380,7 @@
static int ast_say_date_with_format_nl(struct ast_channel *chan, time_t t, const char *ints, const char *lang, const char *format, const char *tzone);
static int ast_say_date_with_format_pl(struct ast_channel *chan, time_t t, const char *ints, const char *lang, const char *format, const char *tzone);
static int ast_say_date_with_format_pt(struct ast_channel *chan, time_t t, const char *ints, const char *lang, const char *format, const char *tzone);
-static int ast_say_date_with_format_tw(struct ast_channel *chan, time_t t, const char *ints, const char *lang, const char *format, const char *tzone);
+static int ast_say_date_with_format_zh(struct ast_channel *chan, time_t t, const char *ints, const char *lang, const char *format, const char *tzone);
static int ast_say_date_with_format_gr(struct ast_channel *chan, time_t t, const char *ints, const char *lang, const char *format, const char *tzone);
static int ast_say_date_with_format_th(struct ast_channel *chan, time_t t, const char *ints, const char *lang, const char *format, const char *tzone);
@@ -390,7 +390,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_hu(struct ast_channel *chan, time_t t, const char *ints, const char *lang);
@@ -403,7 +403,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_hu(struct ast_channel *chan, time_t t, const char *ints, const char *lang);
@@ -460,8 +460,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 */
@@ -2242,8 +2242,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;
@@ -2318,7 +2318,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);
@@ -2328,7 +2328,7 @@
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);
@@ -3489,8 +3489,8 @@
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 (!strcasecmp(lang, "tw") || !strcasecmp(lang, "zh") ) { /* Taiwanese / Chinese syntax */
- return (ast_say_date_with_format_tw(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 */
@@ -5807,7 +5807,7 @@
}
/* Taiwanese / Chinese syntax */
-int ast_say_date_with_format_tw(struct ast_channel *chan, time_t t, const char *ints, const char *lang, const char *format, const char *tzone)
+int ast_say_date_with_format_zh(struct ast_channel *chan, time_t t, const char *ints, const char *lang, const char *format, const char *tzone)
{
struct timeval when = { t, 0 };
struct ast_tm tm;
@@ -5999,7 +5999,7 @@
/* Yesterday */
res = wait_file(chan, ints, "digits/yesterday", lang);
} else {
- res = ast_say_date_with_format_tw(chan, t, ints, lang, "YBdA", tzone);
+ res = ast_say_date_with_format_zh(chan, t, ints, lang, "YBdA", tzone);
}
}
break;
@@ -6024,14 +6024,14 @@
res = wait_file(chan, ints, "digits/yesterday", lang);
} else if (beg_today - 86400 * 6 < t) {
/* Within the last week */
- res = ast_say_date_with_format_tw(chan, t, ints, lang, "A", tzone);
+ res = ast_say_date_with_format_zh(chan, t, ints, lang, "A", tzone);
} else {
- res = ast_say_date_with_format_tw(chan, t, ints, lang, "YBdA", tzone);
+ res = ast_say_date_with_format_zh(chan, t, ints, lang, "YBdA", tzone);
}
}
break;
case 'R':
- res = ast_say_date_with_format_tw(chan, t, ints, lang, "kM", tzone);
+ res = ast_say_date_with_format_zh(chan, t, ints, lang, "kM", tzone);
break;
case 'S':
/* Seconds */
@@ -6054,7 +6054,7 @@
}
break;
case 'T':
- res = ast_say_date_with_format_tw(chan, t, ints, lang, "HMS", tzone);
+ res = ast_say_date_with_format_zh(chan, t, ints, lang, "HMS", tzone);
break;
case ' ':
case ' ':
@@ -6088,9 +6088,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") ) { /* 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") ) {
@@ -6314,7 +6313,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 timeval when = { t, 0 };
struct ast_tm tm;
@@ -6406,8 +6405,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, "th") ) { /* Thai syntax */
@@ -6703,7 +6702,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 timeval when = { t, 0 };
struct ast_tm tm;
More information about the svn-commits
mailing list