]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
app_sayunixtime: Use correct inflection for German time.
authorChristof Efkemann <christof@efkemann.net>
Wed, 1 Jun 2022 19:59:11 +0000 (21:59 +0200)
committerJoshua Colp <jcolp@sangoma.com>
Thu, 9 Jun 2022 08:46:38 +0000 (03:46 -0500)
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

main/say.c

index df9462aa16448a0c3e80fd1e531a81f850420315..8fb5e97607c6ce42ffca8c9fcb5b8c9649c1cdfc 100644 (file)
@@ -4933,6 +4933,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
@@ -4945,7 +4947,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);
                                }