src/Invoke-WcdConfiguration.ps1 carries two parallel translation tables — EN
at lines 138-312, FR at 314-488 — kept in sync entirely by hand.
A key present in one and absent from the other does not throw. PowerShell
returns $null for a missing hashtable key, and the checklist renders a blank
label. So the failure mode is: a French technician sees an unlabelled row, on
that language only, and nobody notices until someone runs the tool in French.
tests/Help.Tests.ps1 already enforces that every public function has a
synopsis, an example, and a documented parameter. Nothing enforces that the two
tables agree.
The test
Dot-source the orchestrator's $T construction for both -ScriptUI values and
compare key sets recursively — Checklist, Labels and Remedy are nested
hashtables, so a flat .Keys comparison misses exactly the cases that hurt.
The orchestrator cannot be dot-sourced without running the whole run
(see #16), so the test needs to extract the two $T literals with the AST
parser, the way Help.Tests.ps1 already extracts function definitions. That is
the honest cost of this test and it is still worth paying — it is ~20 lines and
it closes an entire class of silent bug.
If #16 lands first and the tables move somewhere dot-sourceable, this gets
simpler. Either way the test is the deliverable, not the tidying.
Not in scope
Extracting the tables to src/lang/*.psd1 is #19. This issue leaves them
exactly where they are.
Done when
src/Invoke-WcdConfiguration.ps1carries two parallel translation tables — ENat lines 138-312, FR at 314-488 — kept in sync entirely by hand.
A key present in one and absent from the other does not throw. PowerShell
returns
$nullfor a missing hashtable key, and the checklist renders a blanklabel. So the failure mode is: a French technician sees an unlabelled row, on
that language only, and nobody notices until someone runs the tool in French.
tests/Help.Tests.ps1already enforces that every public function has asynopsis, an example, and a documented parameter. Nothing enforces that the two
tables agree.
The test
Dot-source the orchestrator's
$Tconstruction for both-ScriptUIvalues andcompare key sets recursively —
Checklist,LabelsandRemedyare nestedhashtables, so a flat
.Keyscomparison misses exactly the cases that hurt.The orchestrator cannot be dot-sourced without running the whole run
(see #16), so the test needs to extract the two
$Tliterals with the ASTparser, the way
Help.Tests.ps1already extracts function definitions. That isthe honest cost of this test and it is still worth paying — it is ~20 lines and
it closes an entire class of silent bug.
If #16 lands first and the tables move somewhere dot-sourceable, this gets
simpler. Either way the test is the deliverable, not the tidying.
Not in scope
Extracting the tables to
src/lang/*.psd1is #19. This issue leaves themexactly where they are.
Done when
tests/Translations.Tests.ps1asserts EN and FR expose identical key setsChecklist,LabelsandRemedy