From: Christof Efkemann Date: Wed, 1 Jun 2022 19:59:11 +0000 (+0200) Subject: app_sayunixtime: Use correct inflection for German time. X-Git-Tag: 16.27.0-rc1~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=58cf5d3912a53a5c3aa6410ec1210094aa2868b0;p=thirdparty%2Fasterisk.git app_sayunixtime: Use correct inflection for German time. In function ast_say_date_with_format_de(), take special care when the hour is one o'clock. In this case, the German number "eins" must be inflected to its neutrum form, "ein". This is achieved by playing "digits/1N" instead of "digits/1". Fixes both 12- and 24-hour formats. ASTERISK-30092 Change-Id: Ica9b80125c0b317e378d89c1ea786816e2635510 --- diff --git a/main/say.c b/main/say.c index 56e6b8d456..27a5eda50f 100644 --- a/main/say.c +++ b/main/say.c @@ -4975,6 +4975,8 @@ int ast_say_date_with_format_de(struct ast_channel *chan, time_t t, const char * /* 12-Hour */ if (tm.tm_hour == 0) ast_copy_string(nextmsg, "digits/12", sizeof(nextmsg)); + else if (tm.tm_hour == 1) + ast_copy_string(nextmsg, "digits/1N", sizeof(nextmsg)); else if (tm.tm_hour > 12) snprintf(nextmsg, sizeof(nextmsg), "digits/%d", tm.tm_hour - 12); else @@ -4987,7 +4989,11 @@ int ast_say_date_with_format_de(struct ast_channel *chan, time_t t, const char * case 'H': case 'k': /* 24-Hour */ - res = ast_say_number(chan, tm.tm_hour, ints, lang, (char *) NULL); + if (tm.tm_hour == 1) { + res = wait_file(chan, ints, "digits/1N", lang); + } else { + res = ast_say_number(chan, tm.tm_hour, ints, lang, (char *) NULL); + } if (!res) { res = wait_file(chan, ints, "digits/oclock", lang); }