From 01afb63a3da5b73f2d98371e1498856738399136 Mon Sep 17 00:00:00 2001 From: Dianne Skoll Date: Wed, 11 Dec 2024 18:07:48 -0500 Subject: [PATCH] Sent translations with only the first month, in a multi-month (-pN) output. --- man/rem2ps.1.in | 12 +++++++++++- src/calendar.c | 16 +++++++++++----- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/man/rem2ps.1.in b/man/rem2ps.1.in index 3595c5fa..26fccc7c 100644 --- a/man/rem2ps.1.in +++ b/man/rem2ps.1.in @@ -343,6 +343,11 @@ The line following \fB# translations\fR is a JSON object (on a single line) containing all of the entries of the translation table. Back-ends that are not interested in the translation table can simply read and discard the next line. +.RS +If \fBRemind\fR sends data for multiple months, then only the first month +will include the translation table. +.RE + .TP .B # rem2ps begin This line signifies the start of calendar data. Back-ends can search @@ -447,6 +452,10 @@ This line signifies that the next line will be the translation table. The line following \fB# translations\fR is a JSON object (on a single line) containing all of the entries of the translation table. Back-ends that are not interested in the translation table can simply read and discard +.RS +If \fBRemind\fR sends data for multiple months, then only the first month +will include the translation table. +.RE .TP .B # rem2ps2 begin This line signifies the start of calendar data. Back-ends can search @@ -678,7 +687,8 @@ The year of the following month. (The same as \fByear\fR unless the current month is December.) .TP .B translations \fR{\fIobject\fR} -A complete dump of the Remind translation table. +A complete dump of the Remind translation table. In output for multiple +months, the translation table is included only with the first month. .TP .B entries \fR[\fIarray\fR] The \fBentries\fR key consists of an array of calendar entries; each diff --git a/src/calendar.c b/src/calendar.c index bbd9603b..28cf9790 100644 --- a/src/calendar.c +++ b/src/calendar.c @@ -996,19 +996,25 @@ static void DoSimpleCalendarOneMonth(void) if (PsCal) { FromDSE(DSEToday, &y, &m, &d); if (PsCal == PSCAL_LEVEL1) { - SendTranslationTable(PsCal); + if (!DidAMonth) { + SendTranslationTable(PsCal); + } printf("%s\n", PSBEGIN); } else if (PsCal == PSCAL_LEVEL2) { - SendTranslationTable(PsCal); + if (!DidAMonth) { + SendTranslationTable(PsCal); + } printf("%s\n", PSBEGIN2); } else { if (DidAMonth) { printf(",\n"); } printf("{\n"); - printf("\"translations\":"); - SendTranslationTable(PsCal); - printf(","); + if (!DidAMonth) { + printf("\"translations\":"); + SendTranslationTable(PsCal); + printf(","); + } } if (PsCal < PSCAL_LEVEL3) { printf("%s %d %d %d %d\n",