diff --git a/include/lang/fr.rem b/include/lang/fr.rem index eaf40058..b00bad71 100644 --- a/include/lang/fr.rem +++ b/include/lang/fr.rem @@ -51,9 +51,9 @@ FSET subst_1(alt, date, time) iif(time == now(), "maintenant", \ time > now(), "dans " + subst_tdiff((time-now())/60, (time-now())%60), \ "il y a " + subst_tdiff ((now()-time)/60, (now()-time)%60)) -FSET subst_b(alt, date, time) iif(date==today(), $Today, date==today()+1, $Tomorrow, "dans " + (date-today()) + " jours") -FSET subst_j_alt(date) iif(date==today(), $Today, date==today()+1, $Tomorrow, wkday(date) + ", " + day(date) + subst_ordinal(day(date)) + " " + mon(date) + ", " + year(date)) -FSET subst_j(alt, date, time) iif(date==today(), $Today, date==today()+1, $Tomorrow, alt, subst_j_alt(date), $On + " " + subst_j_alt(date)) +FSET subst_bx(alt, date, time) "dans " + (date-today()) + " jours" +FSET subst_j_alt(date) wkday(date) + ", " + day(date) + subst_ordinal(day(date)) + " " + mon(date) + ", " + year(date) +FSET subst_jx(alt, date, time) iif(alt, subst_j_alt(date), $On + " " + subst_j_alt(date)) -FSET subst_k_alt(date) iif(date==today(), $Today, date==today()+1, $Tomorrow, wkday(date) + ", " + day(date) + subst_ordinal(day(date)) + " " + mon(date)) -FSET subst_k(alt, date, time) iif(date==today(), $Today, date==today()+1, $Tomorrow, alt, subst_k_alt(date), $On + " " + subst_k_alt(date)) +FSET subst_k_alt(date) wkday(date) + ", " + day(date) + subst_ordinal(day(date)) + " " + mon(date) +FSET subst_kx(alt, date, time) iif(alt, subst_k_alt(date), $On + " " + subst_k_alt(date)) diff --git a/src/dosubst.c b/src/dosubst.c index 88a6f308..ae6cdc0c 100644 --- a/src/dosubst.c +++ b/src/dosubst.c @@ -284,6 +284,27 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul, } } + + if (!done) { + snprintf(uf, sizeof(uf), "subst_%cx", c); + if (UserFuncExists(uf) == 3) { + snprintf(s, sizeof(s), "subst_%cx(%d, '%04d-%02d-%02d', %02d:%02d)", + c, altmode ? 1 : 0, y, m+1, d, h, min); + expr = (char const *) s; + r = EvalExpr(&expr, &v, NULL); + if (r == OK) { + if (!DoCoerce(STR_TYPE, &v)) { + if (DBufPuts(dbuf, v.v.str) != OK) { + DestroyValue(v); + return E_NO_MEM; + } + } + DestroyValue(v); + continue; + } + } + } + if (!done) switch(UPPER(c)) { case 'A': #ifdef L_A_OVER