diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-06-14 21:08:23 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-06-14 21:08:23 +0000 |
commit | eaff648d9b225be366870aade0617c6d8ca2a121 (patch) | |
tree | dede3071b59c4222dc70038230d51d72f6916984 | |
parent | 14dbc53ff0071d7e221a7f658050c4bc8410d391 (diff) |
Fix some problems with saying dates and times for the "tw" langauge
(issue #9964, ljmid)
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@69358 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | main/say.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/main/say.c b/main/say.c index 20f73b5b1..4d05848d0 100644 --- a/main/say.c +++ b/main/say.c @@ -5183,7 +5183,7 @@ int ast_say_date_with_format_tw(struct ast_channel *chan, time_t time, const cha char sndfile[256], nextmsg[256]; if (format == NULL) - format = "YBdA 'digits/at' HM"; + format = "YBdAkM"; ast_localtime(&time,&tm,timezone); @@ -5221,16 +5221,17 @@ int ast_say_date_with_format_tw(struct ast_channel *chan, time_t time, const cha case 'e': /* First - Thirtyfirst */ if (!(tm.tm_mday % 10) || (tm.tm_mday < 10)) { - snprintf(nextmsg,sizeof(nextmsg), "digits/h-%d", tm.tm_mday); + snprintf(nextmsg,sizeof(nextmsg), "digits/%d", tm.tm_mday); res = wait_file(chan,ints,nextmsg,lang); } else { - snprintf(nextmsg,sizeof(nextmsg), "digits/h-%dh", tm.tm_mday - (tm.tm_mday % 10)); + snprintf(nextmsg,sizeof(nextmsg), "digits/%d", tm.tm_mday - (tm.tm_mday % 10)); res = wait_file(chan,ints,nextmsg,lang); if(!res) { - snprintf(nextmsg,sizeof(nextmsg), "digits/h-%d", tm.tm_mday % 10); + snprintf(nextmsg,sizeof(nextmsg), "digits/%d", tm.tm_mday % 10); res = wait_file(chan,ints,nextmsg,lang); } } + if(!res) res = wait_file(chan,ints,"ri",lang); break; case 'Y': /* Year */ @@ -5300,12 +5301,12 @@ int ast_say_date_with_format_tw(struct ast_channel *chan, time_t time, const cha } break; case 'H': + if (tm.tm_hour < 10) { + res = wait_file(chan, ints, "digits/0", lang); + } case 'k': /* 24-Hour */ if (!(tm.tm_hour % 10) || tm.tm_hour < 10) { - if (tm.tm_hour < 10) { - res = wait_file(chan, ints, "digits/0", lang); - } snprintf(nextmsg,sizeof(nextmsg), "digits/%d", tm.tm_hour); res = wait_file(chan,ints,nextmsg,lang); } else { @@ -5406,7 +5407,7 @@ int ast_say_date_with_format_tw(struct ast_channel *chan, time_t time, const cha } break; case 'R': - res = ast_say_date_with_format_tw(chan, time, ints, lang, "HM", timezone); + res = ast_say_date_with_format_tw(chan, time, ints, lang, "kM", timezone); break; case 'S': /* Seconds */ |