Skip to content

Test that the EN and FR translation tables expose identical keys #20

Description

@DireDoch

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

  • tests/Translations.Tests.ps1 asserts EN and FR expose identical key sets
  • Comparison recurses into Checklist, Labels and Remedy
  • The test fails when a key is deleted from one table — verified by deleting one
  • Any divergence the test finds today is fixed

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions