From 57ba63c57fca248175aaa39ce319b0c32b8cb966 Mon Sep 17 00:00:00 2001 From: krisf Date: Fri, 9 Oct 2026 13:20:58 -0400 Subject: [PATCH] =?UTF-8?q?Bilingual=20as-of=20line:=20FR=20card/stamp=20s?= =?UTF-8?q?howed=20English=20'October=202026=20(CPP=202026,=20OAS/GIS=20Oc?= =?UTF-8?q?t-Dec=202026,=20tax=202026)'.=20Added=20asOfFr=20(octobre=20202?= =?UTF-8?q?6,=20RPC/SV/SRG,=20imp=C3=B4ts)=20in=20canada.js=20+=20generato?= =?UTF-8?q?r;=20render=20sites=20pick=20by=20getLang().=20Smoke=2090->92?= =?UTF-8?q?=20with=20a=20localization=20guard.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/build_canada.js | 1 + site/app.js | 4 ++-- site/engine/canada.js | 1 + tests/ui.smoke.js | 1 + 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/build_canada.js b/scripts/build_canada.js index 71f0895..773a705 100644 --- a/scripts/build_canada.js +++ b/scripts/build_canada.js @@ -87,6 +87,7 @@ const doc = { generated: "2026-10-08", year: "2026 (live-fetched; plan fallbacks were 2025)", asOf: "October 2026 (CPP 2026, OAS/GIS Oct-Dec 2026, tax 2026)", + asOfFr: "octobre 2026 (RPC 2026, SV/SRG oct.-déc. 2026, impôts 2026)", cppMax65Monthly: { value: 1507.65, source: E + " Table 1, Jan 2026 (incl. CPP enhancement)", asOf: ASOF_ESDC }, ympe: { value: 74600, source: E + " Table 2 YMPE 2026 (YBE $3,500)", asOf: ASOF_ESDC }, oasMax6574Monthly: { value: 762.50, source: O + " Oct-Dec 2026", asOf: ASOF_OAS }, diff --git a/site/app.js b/site/app.js index bde8ba3..2f27da0 100644 --- a/site/app.js +++ b/site/app.js @@ -694,7 +694,7 @@ notes.push(t('ps.card.nPartTime')); notes.push(t('ps.card.nSplit')); h += '

' + notes.join(' ') + '

'; - var asOf = C.asOf, dPspc = '2025-08-15'; + var asOf = (getLang() === 'fr' ? C.asOfFr : C.asOf), dPspc = '2025-08-15'; h += '

' + t('ps.card.sources') + ' ' + '' + t('ps.card.srcPspc', { d: dPspc }) + ' · ' + '' + t('ps.card.srcGlance') + ' · ' + @@ -757,7 +757,7 @@ var m2 = fmtMoney2; $('#stamp').textContent = t('r.stamp', { cpp: m2(C.cppMax65Monthly.value), oas: m2(C.oasMax6574Monthly.value), - gis: m2(C.gisMaxSingleMonthly.value), asOf: C.asOf + gis: m2(C.gisMaxSingleMonthly.value), asOf: getLang() === 'fr' ? C.asOfFr : C.asOf }); var a = state.a; diff --git a/site/engine/canada.js b/site/engine/canada.js index 576ca6f..ad366de 100644 --- a/site/engine/canada.js +++ b/site/engine/canada.js @@ -4,6 +4,7 @@ "generated": "2026-10-08", "year": "2026 (live-fetched; plan fallbacks were 2025)", "asOf": "October 2026 (CPP 2026, OAS/GIS Oct-Dec 2026, tax 2026)", + "asOfFr": "octobre 2026 (RPC 2026, SV/SRG oct.-déc. 2026, impôts 2026)", "cppMax65Monthly": { "value": 1507.65, "source": "https://www.canada.ca/en/employment-social-development/programs/pensions/pension/statistics/2026-quarterly-april-june.html Table 1, Jan 2026 (incl. CPP enhancement)", diff --git a/tests/ui.smoke.js b/tests/ui.smoke.js index a19a023..563d3c0 100644 --- a/tests/ui.smoke.js +++ b/tests/ui.smoke.js @@ -198,6 +198,7 @@ function runPs(lang, M, done) { ok('PS card table uses non-colliding class ps-tbl (grid-on-table would blank the card)', //.test(h) && (h.match(//g) || []).length >= 7, 'rows=' + (h.match(//g) || []).length); + ok('as-of line localized (' + lang + ')', lang === 'fr' ? (!/October|Oct-Dec/.test(h) && /octobre 2026/.test(h)) : /October 2026/.test(h)); ok('PS series in G2 chart', M.psSeries.test(N(q('#g2')._html)), N(q('#g2')._html).slice(0, 40)); ok('PS insight in live panel', M.psInsight.test(N(q('#panel-insight')._html)), N(q('#panel-insight')._html).slice(0, 70)); done();