Skip to content

Fix main CI: CSV General numbers keep their digits; repair the French catalog - #705

Open
mo2menmuhamed wants to merge 2 commits into
storytold:mainfrom
mo2menmuhamed:fix/main-ci
Open

mo2menmuhamed wants to merge 2 commits into
storytold:mainfrom
mo2menmuhamed:fix/main-ci

Conversation

@mo2menmuhamed

Copy link
Copy Markdown

main currently fails cargo xtask ci on every platform: three tests, two independent causes. This PR fixes both, one commit each.

1. CSV: General numbers keep their digits on save

#422 (CSV writes displayed values) and #426 (a file opened as CSV round-trips with its separator) merged minutes apart and broke each other. General displays at most 11 characters, so the 12-digit part code 124412140710 in #426's cut-list fixture is saved as 1.24412E+11. That fails:

  • io::tests::csv_save_keeps_the_separator_it_was_opened_with
  • tests::saving_an_opened_semicolon_csv_keeps_semicolons

Fix: displayed values stay the rule, so dates, currency, percentages and fixed decimals are written exactly as #422 tests them. The one exception: when a General number's displayed text would not read back as the same value, it is written to Excel's 15 significant digits in plain notation. Very large or tiny magnitudes (outside 1e-5 to 1e15) keep General's scientific text.

Excel itself writes the lossy 1.24412E+11, a well-known way to lose IDs and part codes on a CSV round trip. This is a deliberate improvement on Excel, and the doc comment says so.

New test: csv_general_numbers_keep_their_digits (12-digit codes, negatives, already-exact values, 0.1 + 0.2 not written as 0.30000000000000004, huge and tiny magnitudes, NaN).

The same merge left two contradictory .csv rows in docs/file-format-parity.md (one said we write raw values, the other displayed values). They are merged into one accurate row.

#426's cut list opened and saved with gridcraft-cli run:

before (main):  1;562.5;510;Komoda, lijevo;2162PE;19;1MM_2162PE;;;;12441214071A;1.24412E+11
after:          1;562.5;510;Komoda, lijevo;2162PE;19;1MM_2162PE;;;;12441214071A;124412140710

The first row is unchanged. After the fix the saved file is identical to the original.

2. i18n: repair the French catalog's scrambled block

i18n::tests::translations_are_unique_and_preserve_unknown_text fails because French lacks two header/footer labels: "Different First Page" and "Different Odd & Even Pages".

While fixing that I found that 84 labels in i18n/fr.rs, from "Click to add data" to the end of the table, were paired with the wrong English keys. French users saw, for example:

Key Showed Means
Close Société Company
Ruler Enregistrer sous Save As
Sheet Name Feuille de droite à gauche Right-to-left sheet
Save As Enregistrer la feuille sous forme de document PDF… (a PDF export sentence)

Every key in that block is retranslated, and the two missing labels are added. All 84 keys are kept and none are dropped. The test only checked that a translation exists, so it now also spot-checks French values across the block.

Docs: French was listed at 0% in localization-parity.md and ROADMAP.md; it now shows 377 labels (~17%), menus only.

Screenshots: French interface, File › Info

Before (main) After
pr1-fr-backstage-before.png pr1-fr-backstage-after.png

Before: the Info page is titled "Insérer les cellules copiées…" (Insert copied cells), Close reads "Société" (Company), Author reads "Automatique".

Screenshots: French interface, Header & Footer tab

Before (main) After
pr1-fr-header-footer-before.png pr1-fr-header-footer-after.png

Before: Page Number reads "Page précédente" (Previous page), Current Time "Analyse de données" (Data analysis), the two checkboxes are untranslated, and the File tab reads "Nom du fichier" (File name).

Checks

cargo xtask ci: fmt, clippy, tests, assets, layers, wasm and keytips pass.

Side note for Windows contributors: with core.autocrlf=true, the parity step reports docs/parity-checklist.md as out of date. That's a line-ending difference only; the regenerated content is identical.

🤖 Generated with Claude Code

mo2menmuhamed and others added 2 commits October 12, 2026 17:31
storytold#422 (CSV writes displayed values) and storytold#426 (a file opened as CSV round-trips
with its separator) merged minutes apart and broke each other: General shows
at most 11 characters, so the 12-digit part code 124412140710 in storytold#426's cut
list was saved as 1.24412E+11, failing
io::tests::csv_save_keeps_the_separator_it_was_opened_with and
tests::saving_an_opened_semicolon_csv_keeps_semicolons on main.

Displayed values stay the rule (dates, currency, percentages, fixed decimals
as storytold#422 tests them). A General number whose displayed text would not read
back as the same value is written to Excel's 15 significant digits in plain
notation instead; very large or tiny magnitudes keep General's scientific
text. Excel itself writes the lossy 1.24412E+11, a well-known way to lose
IDs and part codes, so this is a deliberate improvement on it.

Docs: file-format-parity's two contradictory .csv rows (left by the same
merge) merged into one; Windows-1256/1251 ANSI CSVs opening garbled noted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From "Click to add data" to the end of i18n/fr.rs, 84 French labels were
paired with the wrong English keys: Close read "Société", Save As read a
sentence about PDF export, Ruler read "Enregistrer sous", Sheet Name read
"Feuille de droite à gauche". Every key in that block is retranslated.

The two header/footer labels the catalog never had ("Different First Page",
"Different Odd & Even Pages") are added; their absence failed
i18n::tests::translations_are_unique_and_preserve_unknown_text on main.
The test only checked that a translation exists, so it now also spot-checks
French labels across the block.

Docs: French listed in localization-parity and ROADMAP (it showed 0%).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant