[Asterisk-code-review] app_sayunixtime: Use correct inflection for	German time. (asterisk[master])
    Friendly Automation 
    asteriskteam at digium.com
       
    Wed Jun  8 19:50:13 CDT 2022
    
    
  
Friendly Automation has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/18629 )
Change subject: app_sayunixtime: Use correct inflection for German time.
......................................................................
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
---
M main/say.c
1 file changed, 7 insertions(+), 1 deletion(-)
Approvals:
  Joshua Colp: Looks good to me, but someone else must approve
  Kevin Harwell: Looks good to me, approved
  Friendly Automation: Approved for Submit
diff --git a/main/say.c b/main/say.c
index df9462a..8fb5e97 100644
--- a/main/say.c
+++ b/main/say.c
@@ -4933,6 +4933,8 @@
 				/* 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 @@
 			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);
 				}
-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/18629
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: Ica9b80125c0b317e378d89c1ea786816e2635510
Gerrit-Change-Number: 18629
Gerrit-PatchSet: 1
Gerrit-Owner: Christof Efkemann <christof at efkemann.net>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20220608/5d91f40f/attachment.html>
    
    
More information about the asterisk-code-review
mailing list