aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_voicemail.c
diff options
context:
space:
mode:
authormurf <murf@f38db490-d61c-443f-a65b-d21fe96a405b>2007-01-29 17:57:08 +0000
committermurf <murf@f38db490-d61c-443f-a65b-d21fe96a405b>2007-01-29 17:57:08 +0000
commit8407d8851334a94e04cf5dfdb0af92dc331be75b (patch)
tree5865ae7f1aa9e7db8f6c0ded337df70661ee35ef /apps/app_voicemail.c
parent077d8107ba63cc729ff6b10e300e8159811683b3 (diff)
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: http://svn.digium.com/svn/asterisk/branches/1.4@52535 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_voicemail.c')
-rw-r--r--apps/app_voicemail.c57
1 files changed, 55 insertions, 2 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 6da5c7bd6..e95e59c6d 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -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 */