Skip to content

i18n: translate sheet tab context menu and AutoSave toggle (fixes #1537) - #1754

Merged
aiongg merged 1 commit into
storytold:mainfrom
dknalp:fix/i18n-sheet-tabs-autosave
Oct 22, 2026
Merged

aiongg merged 1 commit into
storytold:mainfrom
dknalp:fix/i18n-sheet-tabs-autosave

Conversation

@dknalp

@dknalp dknalp commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

Problem

Fixes #1537 — with a non-English interface language set (e.g. Spanish on Linux/Fedora), the following UI elements remained in English regardless of the locale:

  • Sheet tab navigation tooltips: Previous sheet, Next sheet, All sheets, New sheet (⇧F11)
  • Sheet tab context menu: Insert Sheet, Rename, Move or Copy…, Duplicate, Tab Color, No Color, Hide, Unhide…, Protect/Unprotect Sheet…, Select All Sheets
  • Ribbon AutoSave toggle: label and hover text

Root cause: All these strings were hardcoded literals in tabs.rs and ribbon.rs — none were passed through lang.tr(), so they could never be translated. Additionally, the matching translation entries were absent from all 9 language files.

Changes

crates/ui-egui/src/tabs.rs — wrap every hardcoded UI string (navigation tooltips, context menu buttons) with app.ui.language.tr(…). The tr() plumbing was already wired for other strings in the same file; these were simply overlooked.

crates/ui-egui/src/ribbon.rs — wrap the AutoSave label ("AutoSave") and hover text with app.ui.language.tr(…).

crates/ui-egui/src/i18n/{cs,de,es,fr,ko,pt,ru,sr,zh}.rs — add the 130 missing translation entries (each file only receives what it was missing; strings already present are untouched).

Translations follow the terminology of the surrounding strings already in each file.

Testing

  • cargo check -p gridcraft-ui-egui — clean
  • cargo test -p gridcraft-ui-egui --lib — 92 tests, all pass

)

The sheet tab context menu buttons (Insert Sheet, Rename, Move or
Copy…, Duplicate, Tab Color, Hide, Unhide…, Protect/Unprotect Sheet,
Select All Sheets), the navigation tooltips (Previous/Next/All sheets,
New sheet), and the AutoSave toggle label and tooltip in the ribbon were
all hardcoded English — they were never routed through lang.tr().

Fix:
- tabs.rs: wrap every hardcoded UI string with app.ui.language.tr(…)
- ribbon.rs: wrap the AutoSave label and hover text with lang.tr(…)
- i18n/cs,de,es,fr,ko,pt,ru,sr,zh: add the 130 missing translation
  entries (each language only gets the entries it was missing)

Translations produced from first-principles per language, following the
terminology used for other sheet/workbook strings already in each file.

Closes storytold#1537
@CRBBeesy

Copy link
Copy Markdown
Contributor

Thanks for this! It now conflicts with main. In case it helps, the AutoSave part of it, rebased
on main (23829d8c), is a 3-line change plus a test:
main...SoftwareBeesy:autosave-title-bar-i18n

  • ribbon.rs: the label and the tooltip go through app.ui.language.tr(…).
  • i18n/pt.rs: the tooltip in Portuguese (pt.rs already had "AutoSave" → "Salvamento Automático").
  • tests/title_bar_language.rs (kittest): in Portuguese the title bar shows "Salvamento
    Automático" and no "AutoSave"; in English it shows "AutoSave".
  • docs/localization-parity.md: status line and revision row.

The Portuguese tooltip in this PR reads correctly to us (Brazilian Portuguese speakers). Feel free to
pull that commit into this PR, or tell us and we'll open it as a separate PR for #1868.

Tested on Linux: cargo test -p gridcraft-ui-egui --test title_bar_language (2 passed), --lib i18n
(7 passed), clippy -D warnings and cargo fmt --check clean.

(Prepared with the help of an AI coding agent.)

aiongg added a commit to aiongg/gridcraft that referenced this pull request Oct 22, 2026
…anish Hide and Autoguardado; test that the sheet-tab and AutoSave labels translate in es, de, fr, ko, ru, zh, sr
@aiongg
aiongg merged commit 48285a8 into storytold:main Oct 22, 2026
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.

Sheets menu when the app is in Spanish still has every option in english

3 participants