Add %? substitution sequence and translations for "are" and "were"

This commit is contained in:
Dianne Skoll
2025-08-12 19:08:34 -04:00
parent fdaaf2b57a
commit 8523218ef2
18 changed files with 654 additions and 9 deletions

View File

@@ -29,6 +29,8 @@ SET $December "desembre"
SET $Today "avui"
SET $Tomorrow "demà"
TRANSLATE "yesterday" "ahir"
TRANSLATE "are" "són"
TRANSLATE "were" "eren"
FSET subst_bx(a,d,t) iif(d==today()+2, "demà passat", d >= today(), "d'aquí " + (d-today()) + " dies", "fa " + (today()-d) + " dies")

View File

@@ -30,6 +30,8 @@ SET $Today "i dag"
SET $Tomorrow "i morgen"
TRANSLATE "yesterday" "i går"
TRANSLATE "are" "er"
TRANSLATE "were" "var"
BANNER Påmindelse for %w, %d. %m, %y%o:

View File

@@ -32,6 +32,8 @@ SET $Today "heute"
SET $Tomorrow "morgen"
TRANSLATE "yesterday" "gestern"
TRANSLATE "are" "sind"
TRANSLATE "were" "waren"
# Banner
BANNER Termine für %w, den %d. %m %y%o:

View File

@@ -30,6 +30,8 @@ SET $Today "hoy"
SET $Tomorrow "mañana"
TRANSLATE "yesterday" "ayer"
TRANSLATE "are" "son"
TRANSLATE "were" "eran"
BANNER Agenda para el %w, %d%s %m, %y%o:

View File

@@ -30,6 +30,8 @@ SET $Today "tänään"
SET $Tomorrow "huomenna"
TRANSLATE "yesterday" "eilen"
TRANSLATE "are" "ovat"
TRANSLATE "were" "olivat"
BANNER Viestit %wna %d. %mta %y%o:

View File

@@ -30,6 +30,8 @@ SET $Today "aujourd'hui"
SET $Tomorrow "demain"
TRANSLATE "yesterday" "hier"
TRANSLATE "are" "sont"
TRANSLATE "were" "étaient"
SET $On "le"
SET $At "à"

View File

@@ -30,6 +30,8 @@ SET $Today "σήμερα"
SET $Tomorrow "αύριο"
TRANSLATE "yesterday" "εχθές"
TRANSLATE "are" "είναι"
TRANSLATE "were" "ήταν"
BANNER Υπενθυμίσεις: %w, %d %m, %y%o:

View File

@@ -30,6 +30,8 @@ SET $Today "í dag"
SET $Tomorrow "á morgun"
TRANSLATE "yesterday" "í gær"
TRANSLATE "are" "eru"
TRANSLATE "were" "voru"
BANNER Minnisatriði: %w, %d%s %m, %y%o:

View File

@@ -30,6 +30,8 @@ SET $Today "oggi"
SET $Tomorrow "domani"
TRANSLATE "yesterday" "Ieri"
TRANSLATE "are" "sono"
TRANSLATE "were" "erano"
BANNER Promemoria per %w, %d %m %y%o:

View File

@@ -29,6 +29,8 @@ SET $December "december"
SET $Today "vandaag"
SET $Tomorrow "morgen"
TRANSLATE "yesterday" "gisteren"
TRANSLATE "are" "zijn"
TRANSLATE "were" "waren"
BANNER Herinneringen voor %w, %d %m, %y%o:

View File

@@ -30,6 +30,8 @@ SET $Today "i dag"
SET $Tomorrow "i morgen"
TRANSLATE "yesterday" "i går"
TRANSLATE "are" "er"
TRANSLATE "were" "var"
BANNER Påminnelse for %w, %d. %m, %y%o:

View File

@@ -30,6 +30,8 @@ SET $Today "dzisiaj"
SET $Tomorrow "jutro"
TRANSLATE "yesterday" "wczoraj"
TRANSLATE "are" "są"
TRANSLATE "were" "byli"
BANNER Terminarz na %w, %d. %m %y%o:

View File

@@ -30,6 +30,8 @@ SET $Today "hoje"
SET $Tomorrow "amanhã"
TRANSLATE "yesterday" "ontem"
TRANSLATE "are" "são"
TRANSLATE "were" "eram"
BANNER Avisos para %w, %d de %m de %y%o:

View File

@@ -29,6 +29,8 @@ SET $December "Decembrie"
SET $Today "astăzi"
SET $Tomorrow "mâine"
TRANSLATE "yesterday" "ieri"
TRANSLATE "are" "sunt"
TRANSLATE "were" "au fost"
BANNER Reamintiri pentru %w, %d %m %y%o:

View File

@@ -69,6 +69,7 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig const *tt, int
char const *pm, *cpm;
int tdiff, adiff, mdiff, hdiff;
char const *mplu, *hplu, *when, *plu;
char const *is, *was;
int has_quote = 0;
char *ss;
char const *expr;
@@ -415,7 +416,7 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig const *tt, int
}
}
if (origtime == NO_TIME) {
if ((c >= '0' && c <= '9') || (c == '!')) {
if ((c >= '0' && c <= '9')) {
Wprint(tr("`%%%c' substitution sequence should not be used without an AT clause"), c);
}
}
@@ -684,18 +685,25 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig const *tt, int
break;
case '!':
case '?':
if (c == '!') {
is = tr("is");
was = tr("was");
} else {
is = tr("are");
was = tr("were");
}
if (altmode) {
bangdiff = rdiff;
} else {
bangdiff = diff;
}
if (bangdiff > 0) {
snprintf(s, sizeof(s), "%s", tr("is"));
snprintf(s, sizeof(s), "%s", is);
} else if (bangdiff < 0) {
snprintf(s, sizeof(s), "%s", tr("was"));
snprintf(s, sizeof(s), "%s", was);
} else {
snprintf(s, sizeof(s), "%s", (tdiff >= 0 ? tr("is") :
tr("was")));
snprintf(s, sizeof(s), "%s", (tdiff >= 0 ? is : was));
}
SHIP_OUT(s);
break;

View File

@@ -704,7 +704,7 @@ EOF
# Test diagnostics when using a timed substitution without an AT clause
../src/remind - 1 Feb 2024 1:00 <<EOF >> ../tests/test.out 2>&1
REM MSG %0 %1 %2 %3 %4 %5 %6 %7 %8 %9 %! hahaha
REM MSG %0 %1 %2 %3 %4 %5 %6 %7 %8 %9 hahaha
EOF
# Test translate table dumping

File diff suppressed because it is too large Load Diff

View File

@@ -38,7 +38,7 @@ endif
REM MSG Language: %(LANGID)
# Set up a few useful definitions
fset show(x) iif(x == "!", "%%" + x + " yields: " + char(34) + "%" + x + char(34), "%%" + x + " yields: " + char(34) + "%" + x + char(34) + "% and %%*" + x + " yields: " + char(34) + "%*" + x + char(34) + "%")
fset show(x) iif(x == "!" || x == "?", "%%" + x + " yields: " + char(34) + "%" + x + char(34), "%%" + x + " yields: " + char(34) + "%" + x + char(34) + "% and %%*" + x + " yields: " + char(34) + "%*" + x + char(34) + "%")
set a trigger(today()+2) + " ++2"
set l language()
set tt now()+134
@@ -319,6 +319,7 @@ REM AT [now()] MSG [show("8")]
REM AT [now()] MSG [show("9")]
REM AT [now()] MSG [show("0")]
REM AT [now()] MSG [show("!")]
REM AT [now()] MSG [show("?")]
REM AT [now()] MSG [show("@")]
REM AT [now()] MSG [show("#")]
MSG %_Time substitutions for [now()+134] where now() = [now()]
@@ -333,6 +334,7 @@ REM AT [now()+134] MSG [show("8")]
REM AT [now()+134] MSG [show("9")]
REM AT [now()+134] MSG [show("0")]
REM AT [now()+134] MSG [show("!")]
REM AT [now()+134] MSG [show("?")]
REM AT [now()+134] MSG [show("@")]
REM AT [now()+134] MSG [show("#")]
MSG %_Time substitutions for [now()-134] where now() = [now()]
@@ -347,6 +349,7 @@ REM AT [now()-134] MSG [show("8")]
REM AT [now()-134] MSG [show("9")]
REM AT [now()-134] MSG [show("0")]
REM AT [now()-134] MSG [show("!")]
REM AT [now()-134] MSG [show("?")]
REM AT [now()-134] MSG [show("@")]
REM AT [now()-134] MSG [show("#")]
MSG %_Time substitutions for [now()+60] where now() = [now()]
@@ -361,6 +364,7 @@ REM AT [now()+60] MSG [show("8")]
REM AT [now()+60] MSG [show("9")]
REM AT [now()+60] MSG [show("0")]
REM AT [now()+60] MSG [show("!")]
REM AT [now()+60] MSG [show("?")]
REM AT [now()+60] MSG [show("@")]
REM AT [now()+60] MSG [show("#")]
MSG %_Time substitutions for [now()-60] where now() = [now()]
@@ -375,6 +379,7 @@ REM AT [now()-60] MSG [show("8")]
REM AT [now()-60] MSG [show("9")]
REM AT [now()-60] MSG [show("0")]
REM AT [now()-60] MSG [show("!")]
REM AT [now()-60] MSG [show("?")]
REM AT [now()-60] MSG [show("@")]
REM AT [now()-60] MSG [show("#")]
MSG %_Time substitutions for [now()+120] where now() = [now()]
@@ -389,6 +394,7 @@ REM AT [now()+120] MSG [show("8")]
REM AT [now()+120] MSG [show("9")]
REM AT [now()+120] MSG [show("0")]
REM AT [now()+120] MSG [show("!")]
REM AT [now()+120] MSG [show("?")]
REM AT [now()+120] MSG [show("@")]
REM AT [now()+120] MSG [show("#")]
MSG %_Time substitutions for [now()-120] where now() = [now()]
@@ -403,6 +409,7 @@ REM AT [now()-120] MSG [show("8")]
REM AT [now()-120] MSG [show("9")]
REM AT [now()-120] MSG [show("0")]
REM AT [now()-120] MSG [show("!")]
REM AT [now()-120] MSG [show("?")]
REM AT [now()-120] MSG [show("@")]
REM AT [now()-120] MSG [show("#")]
MSG %_Time substitutions for [now()+1] where now() = [now()]
@@ -417,6 +424,7 @@ REM AT [now()+1] MSG [show("8")]
REM AT [now()+1] MSG [show("9")]
REM AT [now()+1] MSG [show("0")]
REM AT [now()+1] MSG [show("!")]
REM AT [now()+1] MSG [show("?")]
REM AT [now()+1] MSG [show("@")]
REM AT [now()+1] MSG [show("#")]
MSG %_Time substitutions for [now()-1] where now() = [now()]
@@ -431,6 +439,7 @@ REM AT [now()-1] MSG [show("8")]
REM AT [now()-1] MSG [show("9")]
REM AT [now()-1] MSG [show("0")]
REM AT [now()-1] MSG [show("!")]
REM AT [now()-1] MSG [show("?")]
REM AT [now()-1] MSG [show("@")]
REM AT [now()-1] MSG [show("#")]
MSG %_Time substitutions for [now()+2] where now() = [now()]
@@ -445,6 +454,7 @@ REM AT [now()+2] MSG [show("8")]
REM AT [now()+2] MSG [show("9")]
REM AT [now()+2] MSG [show("0")]
REM AT [now()+2] MSG [show("!")]
REM AT [now()+2] MSG [show("?")]
REM AT [now()+2] MSG [show("@")]
REM AT [now()+2] MSG [show("#")]
MSG %_Time substitutions for [now()-2] where now() = [now()]
@@ -459,6 +469,7 @@ REM AT [now()-2] MSG [show("8")]
REM AT [now()-2] MSG [show("9")]
REM AT [now()-2] MSG [show("0")]
REM AT [now()-2] MSG [show("!")]
REM AT [now()-2] MSG [show("?")]
REM AT [now()-2] MSG [show("@")]
REM AT [now()-2] MSG [show("#")]
MSG %_Time substitutions for [0:00] where now() = [now()]
@@ -473,6 +484,7 @@ REM AT [0:00] MSG [show("8")]
REM AT [0:00] MSG [show("9")]
REM AT [0:00] MSG [show("0")]
REM AT [0:00] MSG [show("!")]
REM AT [0:00] MSG [show("?")]
REM AT [0:00] MSG [show("@")]
REM AT [0:00] MSG [show("#")]
MSG %_Time substitutions for [1:00] where now() = [now()]
@@ -487,6 +499,7 @@ REM AT [1:00] MSG [show("8")]
REM AT [1:00] MSG [show("9")]
REM AT [1:00] MSG [show("0")]
REM AT [1:00] MSG [show("!")]
REM AT [1:00] MSG [show("?")]
REM AT [1:00] MSG [show("@")]
REM AT [1:00] MSG [show("#")]
MSG %_Time substitutions for [2:00] where now() = [now()]
@@ -501,6 +514,7 @@ REM AT [2:00] MSG [show("8")]
REM AT [2:00] MSG [show("9")]
REM AT [2:00] MSG [show("0")]
REM AT [2:00] MSG [show("!")]
REM AT [2:00] MSG [show("?")]
REM AT [2:00] MSG [show("@")]
REM AT [2:00] MSG [show("#")]
MSG %_Time substitutions for [3:00] where now() = [now()]
@@ -515,6 +529,7 @@ REM AT [3:00] MSG [show("8")]
REM AT [3:00] MSG [show("9")]
REM AT [3:00] MSG [show("0")]
REM AT [3:00] MSG [show("!")]
REM AT [3:00] MSG [show("?")]
REM AT [3:00] MSG [show("@")]
REM AT [3:00] MSG [show("#")]
MSG %_Time substitutions for [4:00] where now() = [now()]
@@ -529,6 +544,7 @@ REM AT [4:00] MSG [show("8")]
REM AT [4:00] MSG [show("9")]
REM AT [4:00] MSG [show("0")]
REM AT [4:00] MSG [show("!")]
REM AT [4:00] MSG [show("?")]
REM AT [4:00] MSG [show("@")]
REM AT [4:00] MSG [show("#")]
MSG %_Time substitutions for [5:00] where now() = [now()]
@@ -543,6 +559,7 @@ REM AT [5:00] MSG [show("8")]
REM AT [5:00] MSG [show("9")]
REM AT [5:00] MSG [show("0")]
REM AT [5:00] MSG [show("!")]
REM AT [5:00] MSG [show("?")]
REM AT [5:00] MSG [show("@")]
REM AT [5:00] MSG [show("#")]
MSG %_Time substitutions for [6:00] where now() = [now()]
@@ -557,6 +574,7 @@ REM AT [6:00] MSG [show("8")]
REM AT [6:00] MSG [show("9")]
REM AT [6:00] MSG [show("0")]
REM AT [6:00] MSG [show("!")]
REM AT [6:00] MSG [show("?")]
REM AT [6:00] MSG [show("@")]
REM AT [6:00] MSG [show("#")]
MSG %_Time substitutions for [7:00] where now() = [now()]
@@ -571,6 +589,7 @@ REM AT [7:00] MSG [show("8")]
REM AT [7:00] MSG [show("9")]
REM AT [7:00] MSG [show("0")]
REM AT [7:00] MSG [show("!")]
REM AT [7:00] MSG [show("?")]
REM AT [7:00] MSG [show("@")]
REM AT [7:00] MSG [show("#")]
MSG %_Time substitutions for [8:00] where now() = [now()]
@@ -585,6 +604,7 @@ REM AT [8:00] MSG [show("8")]
REM AT [8:00] MSG [show("9")]
REM AT [8:00] MSG [show("0")]
REM AT [8:00] MSG [show("!")]
REM AT [8:00] MSG [show("?")]
REM AT [8:00] MSG [show("@")]
REM AT [8:00] MSG [show("#")]
MSG %_Time substitutions for [9:00] where now() = [now()]
@@ -599,6 +619,7 @@ REM AT [9:00] MSG [show("8")]
REM AT [9:00] MSG [show("9")]
REM AT [9:00] MSG [show("0")]
REM AT [9:00] MSG [show("!")]
REM AT [9:00] MSG [show("?")]
REM AT [9:00] MSG [show("@")]
REM AT [9:00] MSG [show("#")]
MSG %_Time substitutions for [10:00] where now() = [now()]
@@ -613,6 +634,7 @@ REM AT [10:00] MSG [show("8")]
REM AT [10:00] MSG [show("9")]
REM AT [10:00] MSG [show("0")]
REM AT [10:00] MSG [show("!")]
REM AT [10:00] MSG [show("?")]
REM AT [10:00] MSG [show("@")]
REM AT [10:00] MSG [show("#")]
MSG %_Time substitutions for [11:00] where now() = [now()]
@@ -627,6 +649,7 @@ REM AT [11:00] MSG [show("8")]
REM AT [11:00] MSG [show("9")]
REM AT [11:00] MSG [show("0")]
REM AT [11:00] MSG [show("!")]
REM AT [11:00] MSG [show("?")]
REM AT [11:00] MSG [show("@")]
REM AT [11:00] MSG [show("#")]
MSG %_Time substitutions for [11:59] where now() = [now()]
@@ -641,6 +664,7 @@ REM AT [11:59] MSG [show("8")]
REM AT [11:59] MSG [show("9")]
REM AT [11:59] MSG [show("0")]
REM AT [11:59] MSG [show("!")]
REM AT [11:59] MSG [show("?")]
REM AT [11:59] MSG [show("@")]
REM AT [11:59] MSG [show("#")]
MSG %_Time substitutions for [12:00] where now() = [now()]
@@ -655,6 +679,7 @@ REM AT [12:00] MSG [show("8")]
REM AT [12:00] MSG [show("9")]
REM AT [12:00] MSG [show("0")]
REM AT [12:00] MSG [show("!")]
REM AT [12:00] MSG [show("?")]
REM AT [12:00] MSG [show("@")]
REM AT [12:00] MSG [show("#")]
MSG %_Time substitutions for [12:01] where now() = [now()]
@@ -669,6 +694,7 @@ REM AT [12:01] MSG [show("8")]
REM AT [12:01] MSG [show("9")]
REM AT [12:01] MSG [show("0")]
REM AT [12:01] MSG [show("!")]
REM AT [12:01] MSG [show("?")]
REM AT [12:01] MSG [show("@")]
REM AT [12:01] MSG [show("#")]
MSG %_Time substitutions for [13:00] where now() = [now()]
@@ -683,6 +709,7 @@ REM AT [13:00] MSG [show("8")]
REM AT [13:00] MSG [show("9")]
REM AT [13:00] MSG [show("0")]
REM AT [13:00] MSG [show("!")]
REM AT [13:00] MSG [show("?")]
REM AT [13:00] MSG [show("@")]
REM AT [13:00] MSG [show("#")]
MSG %_Time substitutions for [14:00] where now() = [now()]
@@ -697,6 +724,7 @@ REM AT [14:00] MSG [show("8")]
REM AT [14:00] MSG [show("9")]
REM AT [14:00] MSG [show("0")]
REM AT [14:00] MSG [show("!")]
REM AT [14:00] MSG [show("?")]
REM AT [14:00] MSG [show("@")]
REM AT [14:00] MSG [show("#")]
MSG %_Time substitutions for [15:00] where now() = [now()]
@@ -711,6 +739,7 @@ REM AT [15:00] MSG [show("8")]
REM AT [15:00] MSG [show("9")]
REM AT [15:00] MSG [show("0")]
REM AT [15:00] MSG [show("!")]
REM AT [15:00] MSG [show("?")]
REM AT [15:00] MSG [show("@")]
REM AT [15:00] MSG [show("#")]
MSG %_Time substitutions for [16:00] where now() = [now()]
@@ -725,6 +754,7 @@ REM AT [16:00] MSG [show("8")]
REM AT [16:00] MSG [show("9")]
REM AT [16:00] MSG [show("0")]
REM AT [16:00] MSG [show("!")]
REM AT [16:00] MSG [show("?")]
REM AT [16:00] MSG [show("@")]
REM AT [16:00] MSG [show("#")]
MSG %_Time substitutions for [17:00] where now() = [now()]
@@ -739,6 +769,7 @@ REM AT [17:00] MSG [show("8")]
REM AT [17:00] MSG [show("9")]
REM AT [17:00] MSG [show("0")]
REM AT [17:00] MSG [show("!")]
REM AT [17:00] MSG [show("?")]
REM AT [17:00] MSG [show("@")]
REM AT [17:00] MSG [show("#")]
MSG %_Time substitutions for [18:00] where now() = [now()]
@@ -753,6 +784,7 @@ REM AT [18:00] MSG [show("8")]
REM AT [18:00] MSG [show("9")]
REM AT [18:00] MSG [show("0")]
REM AT [18:00] MSG [show("!")]
REM AT [18:00] MSG [show("?")]
REM AT [18:00] MSG [show("@")]
REM AT [18:00] MSG [show("#")]
MSG %_Time substitutions for [19:00] where now() = [now()]
@@ -767,6 +799,7 @@ REM AT [19:00] MSG [show("8")]
REM AT [19:00] MSG [show("9")]
REM AT [19:00] MSG [show("0")]
REM AT [19:00] MSG [show("!")]
REM AT [19:00] MSG [show("?")]
REM AT [19:00] MSG [show("@")]
REM AT [19:00] MSG [show("#")]
MSG %_Time substitutions for [20:00] where now() = [now()]
@@ -781,6 +814,7 @@ REM AT [20:00] MSG [show("8")]
REM AT [20:00] MSG [show("9")]
REM AT [20:00] MSG [show("0")]
REM AT [20:00] MSG [show("!")]
REM AT [20:00] MSG [show("?")]
REM AT [20:00] MSG [show("@")]
REM AT [20:00] MSG [show("#")]
MSG %_Time substitutions for [21:00] where now() = [now()]
@@ -795,6 +829,7 @@ REM AT [21:00] MSG [show("8")]
REM AT [21:00] MSG [show("9")]
REM AT [21:00] MSG [show("0")]
REM AT [21:00] MSG [show("!")]
REM AT [21:00] MSG [show("?")]
REM AT [21:00] MSG [show("@")]
REM AT [21:00] MSG [show("#")]
MSG %_Time substitutions for [22:00] where now() = [now()]
@@ -809,6 +844,7 @@ REM AT [22:00] MSG [show("8")]
REM AT [22:00] MSG [show("9")]
REM AT [22:00] MSG [show("0")]
REM AT [22:00] MSG [show("!")]
REM AT [22:00] MSG [show("?")]
REM AT [22:00] MSG [show("@")]
REM AT [22:00] MSG [show("#")]
MSG %_Time substitutions for [23:00] where now() = [now()]
@@ -823,6 +859,7 @@ REM AT [23:00] MSG [show("8")]
REM AT [23:00] MSG [show("9")]
REM AT [23:00] MSG [show("0")]
REM AT [23:00] MSG [show("!")]
REM AT [23:00] MSG [show("?")]
REM AT [23:00] MSG [show("@")]
REM AT [23:00] MSG [show("#")]
MSG %_Time substitutions for [23:59] where now() = [now()]
@@ -837,6 +874,7 @@ REM AT [23:59] MSG [show("8")]
REM AT [23:59] MSG [show("9")]
REM AT [23:59] MSG [show("0")]
REM AT [23:59] MSG [show("!")]
REM AT [23:59] MSG [show("?")]
REM AT [23:59] MSG [show("@")]
REM AT [23:59] MSG [show("#")]