this is for 8778 (pt_BR backport to 1.4). It was committed to trunk via 7663. But it wasn't so much an enhancement as a fix for the bad language output for portuguese in Brazil, so, after a lot of prodding from patient Brazilians, here is the same fix for 1.4

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@52535 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Steve Murphy
2007-01-29 17:57:08 +00:00
parent e67ade2403
commit f2fab700c3
2 changed files with 262 additions and 78 deletions

View File

@@ -223,6 +223,7 @@ static int load_config(void);
\arg \b nl - Dutch
\arg \b pt - Polish
\arg \b pt - Portuguese
\arg \b pt_BR - Portuguese (Brazil)
\arg \b gr - Greek
\arg \b no - Norwegian
\arg \b se - Swedish
@@ -4241,6 +4242,8 @@ static int play_message_datetime(struct ast_channel *chan, struct ast_vm_user *v
res = ast_say_date_with_format(chan, t, AST_DIGIT_ANY, chan->language, "'vm-received' q 'digits/at' 'digits/hours' k 'digits/e' M 'digits/minutes'", NULL);
else if (!strcasecmp(chan->language,"gr"))
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
res = ast_say_date_with_format(chan, t, AST_DIGIT_ANY, chan->language, "'vm-received' q 'digits/at' IMp", NULL);
#if 0
@@ -4870,7 +4873,7 @@ static int vm_play_folder_name(struct ast_channel *chan, char *mbox)
{
int cmd;
if (!strcasecmp(chan->language, "it") || !strcasecmp(chan->language, "es") || !strcasecmp(chan->language, "fr") || !strcasecmp(chan->language, "pt")) { /* Italian, Spanish, French or Portuguese syntax */
if (!strcasecmp(chan->language, "it") || !strcasecmp(chan->language, "es") || !strcasecmp(chan->language, "fr") || !strcasecmp(chan->language, "pt") || !strcasecmp(chan->language, "pt_BR")) { /* Italian, Spanish, French or Portuguese syntax */
cmd = ast_play_and_wait(chan, "vm-messages"); /* "messages */
return cmd ? cmd : ast_play_and_wait(chan, mbox);
} else if (!strcasecmp(chan->language, "gr")){
@@ -5272,6 +5275,54 @@ static int vm_intro_es(struct ast_channel *chan,struct vm_state *vms)
return res;
}
/* BRAZILIAN PORTUGUESE syntax */
static int vm_intro_pt_BR(struct ast_channel *chan,struct vm_state *vms) {
/* Introduce messages they have */
int res;
if (!vms->oldmessages && !vms->newmessages) {
res = ast_play_and_wait(chan, "vm-nomessages");
return res;
}
else {
res = ast_play_and_wait(chan, "vm-youhave");
}
if (vms->newmessages) {
if (!res)
res = ast_say_number(chan, vms->newmessages, AST_DIGIT_ANY, chan->language, "f");
if ((vms->newmessages == 1)) {
if (!res)
res = ast_play_and_wait(chan, "vm-message");
if (!res)
res = ast_play_and_wait(chan, "vm-INBOXs");
}
else {
if (!res)
res = ast_play_and_wait(chan, "vm-messages");
if (!res)
res = ast_play_and_wait(chan, "vm-INBOX");
}
if (vms->oldmessages && !res)
res = ast_play_and_wait(chan, "vm-and");
}
if (vms->oldmessages) {
if (!res)
res = ast_say_number(chan, vms->oldmessages, AST_DIGIT_ANY, chan->language, "f");
if (vms->oldmessages == 1) {
if (!res)
res = ast_play_and_wait(chan, "vm-message");
if (!res)
res = ast_play_and_wait(chan, "vm-Olds");
}
else {
if (!res)
res = ast_play_and_wait(chan, "vm-messages");
if (!res)
res = ast_play_and_wait(chan, "vm-Old");
}
}
return res;
}
/* FRENCH syntax */
static int vm_intro_fr(struct ast_channel *chan,struct vm_state *vms)
{
@@ -5587,6 +5638,8 @@ static int vm_intro(struct ast_channel *chan, struct ast_vm_user *vmu, struct vm
return vm_intro_nl(chan, vms);
} else if (!strcasecmp(chan->language, "pt")) { /* PORTUGUESE syntax */
return vm_intro_pt(chan, vms);
} else if (!strcasecmp(chan->language, "pt_BR")) { /* BRAZILIAN PORTUGUESE syntax */
return vm_intro_pt_BR(chan, vms);
} else if (!strcasecmp(chan->language, "cz")) { /* CZECH syntax */
return vm_intro_cz(chan, vms);
} else if (!strcasecmp(chan->language, "gr")) { /* GREEK syntax */
@@ -6005,7 +6058,7 @@ static int vm_browse_messages(struct ast_channel *chan, struct vm_state *vms, st
return vm_browse_messages_es(chan, vms, vmu);
} else if (!strcasecmp(chan->language, "it")) { /* ITALIAN */
return vm_browse_messages_it(chan, vms, vmu);
} else if (!strcasecmp(chan->language, "pt")) { /* PORTUGUESE */
} else if (!strcasecmp(chan->language, "pt") || !strcasecmp(chan->language, "pt_BR")) { /* PORTUGUESE */
return vm_browse_messages_pt(chan, vms, vmu);
} else if (!strcasecmp(chan->language, "gr")){
return vm_browse_messages_gr(chan, vms, vmu); /* GREEK */