Skip to content

fix(i18n): French labels name unrelated actions and omit two required translations #529

Open

Description

@coygeek

Runtime or environment

  • Baseline commit: 3926d21
  • Package under test: gridcraft-ui-egui v0.5.0.

Summary

Selecting Français can label the Ruler control as Save As and replace the Save As label with a PDF-export description. Two Header & Footer options also lack French entries, causing the existing translation-coverage test to fail. The public translation lookup reproduces these results; the application window was not opened.

Steps to reproduce

  1. Set TASK_TARGET_DIR to a disposable build directory. From the repository root at the stated baseline, run the existing focused test:
CARGO_TARGET_DIR="$TASK_TARGET_DIR" CARGO_BUILD_JOBS=4 nice -n 10 cargo test -p gridcraft-ui-egui --lib i18n::tests::translations_are_unique_and_preserve_unknown_text -- --exact
  1. Observe the failure reporting missing French: Different First Page.
  2. Inspect the relevant catalog entries with this read-only command:
rg -n '"Ruler"|"Save As"|Different First Page|Different Odd & Even Pages' crates/ui-egui/src/i18n/fr.rs
  1. The following public-API test also reproduces the lookup results. Save it as crates/ui-egui/tests/french_catalog_probe.rs, run the command below, then remove that disposable test file.
use gridcraft_ui_egui::i18n::Language;

#[test]
fn french_catalog_lookup_observation() {
    assert_eq!(Language::parse("fr"), Some(Language::Fr));
    assert!(Language::ALL.contains(&Language::Fr));
    for (key, actual) in [
        ("Ruler", "Enregistrer sous"),
        ("Save As", "Enregistrer la feuille sous forme de document PDF en conservant sa mise en page."),
        ("Different First Page", "Different First Page"),
        ("Different Odd & Even Pages", "Different Odd & Even Pages"),
        ("Data", "Données"),
    ] {
        assert_eq!(Language::Fr.tr(key), actual);
        assert_eq!(Language::En.tr(key), key);
        println!("{key:?} => {:?}", Language::Fr.tr(key));
    }
}
CARGO_TARGET_DIR="$TASK_TARGET_DIR" CARGO_BUILD_JOBS=4 nice -n 10 cargo test -p gridcraft-ui-egui --test french_catalog_probe french_catalog_lookup_observation -- --exact --nocapture

The same test body was executed during verification under a disposable filename and passed. Its assertions capture the erroneous baseline outputs. They are observation checks, not desired regression expectations.

Expected behavior

French interface labels should describe the same controls and actions as their English keys. Ruler should identify the ruler, and Save As should identify saving under another name or location. The existing coverage check also requires a nonempty French translation for every reference key, including Different First Page and Different Odd & Even Pages.

Actual behavior

The focused coverage test exits with status 101 and reports missing French: Different First Page. The public lookup returns Enregistrer sous, meaning Save As, for Ruler, and Enregistrer la feuille sous forme de document PDF en conservant sa mise en page., a PDF-export description, for Save As. Both missing options return their original English labels. The Data control returns Données, confirming that French lookup works for an unaffected key.

Read-only catalog comparison finds 379 French keys against 381 reference keys. The only missing keys are Different First Page and Different Odd & Even Pages. Source inspection establishes that the View Ruler checkbox, Backstage Save As navigation, and Header & Footer options use this lookup. No rendered UI behavior was directly observed.

Evidence

  • Expected source: crates/ui-egui/src/i18n.rs:1 documents interface translation and English fallback; crates/ui-egui/src/i18n.rs:113 documents the public label lookup; crates/ui-egui/src/i18n.rs:589 requires French coverage of the reference keys.
  • Failure source: crates/ui-egui/src/i18n/fr.rs:324 maps Ruler to Save As text, and crates/ui-egui/src/i18n/fr.rs:331 maps Save As to a PDF-export description; the focused test and public-API observation test reproduce the contrary results.
  • Evidence provenance: observed
  • Local verification: reproduced
  • Reproduction completeness: complete

The relevant UI consumers are crates/ui-egui/src/ribbon.rs:2112, crates/ui-egui/src/backstage.rs:166, and crates/ui-egui/src/paper_view.rs:656. The View language switcher includes Français, and the language-setting command accepts its code.

Restoration check

The existing focused coverage test should pass with both missing options translated. Public French lookup for Ruler and Save As should describe their own actions rather than the recorded unrelated actions. Check those meanings independently of coverage, because a nonempty wrong translation passes the coverage assertion. Preserve the correct Data translation and English labels as controls. Review the remaining French entries for the same mismatch; passing the two spot checks alone does not establish that the catalog is correct.

Additional context

Related proposed fixes: PR #454 addresses the same incorrect French labels and missing keys. PR #449 adds the two missing keys but leaves the incorrect existing labels, and PR #455 was closed without merging in favor of PR #454. This report provides independent lookup and coverage evidence for the tested main revision.

Triage assessment

  • Impact level: P2
  • Assessment status: supported
  • Impact basis: A supported language gives misleading names to navigation and controls, and its required coverage check fails at the baseline. These failures recur for the affected keys. No calculation error, data loss, or failure to execute the underlying command was observed.
  • Workaround status: available
  • Workaround basis: Selecting English uses the original labels, as verified by the public lookup probe. The switcher displays language choices in their own names, so English remains identifiable from the French interface. This preserves the controls' meaning while giving up French labels.

Activity

  1. coygeek commented on Oct 13, 2026

    @coygeek
    Author

    Status at main 45221f5, after PR #454 was merged:

    Fixed

    • Language::Fr.tr("Ruler") now returns Règle, and Save As returns Enregistrer sous.
    • Different First Page and Different Odd & Even Pages now have French entries. The focused test i18n::tests::translations_are_unique_and_preserve_unknown_text passes, the Data → Données control is unchanged, and English lookups return their keys.

    Still wrong (the restoration check's full-catalog review)

    I compared all 381 French entries with their English keys. These still don't match what the UI does or labels:

    1. CSV says semicolon, but the export writes commas. PR fix(i18n): correct scattered wrong French translations and add 2 missing keys #454 (commit c59e942) changed these entries to say semicolon:

      • CSV (Comma delimited) → CSV (séparateur point-virgule)
      • CSV UTF-8 (Comma delimited) (*.csv) → CSV UTF-8 (séparateur point-virgule) (*.csv)
      • Save the active sheet as comma-separated text. → …texte séparé par des points-virgules.

      Before that PR, these entries held unrelated text, and the old Browse… entry read CSV (séparé par des virgules). CSV export doesn't depend on the interface language. crates/engine/src/io.rs:181 writes a workbook with wb.csv_delimiter.unwrap_or(b','), so a new workbook exports with commas. Only a CSV that was opened with ; keeps semicolons. The engine test io::tests::delimited_exports_preserve_general_precision_and_explicit_number_formats asserts comma output for a new workbook saved as data.csv, and it passes on this revision.

    2. context| prefixes now show up in French labels. PR fix(i18n): correct scattered wrong French translations and add 2 missing keys #454 changed these three values to include the context prefix:

      • Sheet Options|View → Options de la feuille|Affichage (it was Affichage)
      • Options|General → Options|Général
      • Options|Save → Options|Enregistrer

      Language::tr removes the prefix only when it falls back to English (i18n.rs:133). A translated value is returned as written. The Page Layout Gridlines/Headings checkbox (ribbon.rs:1707) and the Backstage Options section headings (backstage.rs:794, :827) display that value directly, pipe included. The Japanese, Spanish, German, Korean, and Russian catalogs translate only the label.

    3. Sparklines → Courbes de tendance. That phrase means Trendlines, which is a different chart feature. French Excel calls this Graphiques sparkline.

    Item 2 is visible in every French session. A coverage-style check catches it: no translated value for a context|label key should contain |. Items 1 and 3 need a meaning-level fix. Items 1 and 2 were introduced by the PR that fixed the original labels.

    Open PR #449 no longer touches the French catalog. It dropped its French commit after main gained the two keys.

    Keeping this open for the entries above.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions