Skip to content

Support common Spanish formula names and semicolon arguments - #98

Merged
h-a-n-a-s-h-i merged 1 commit into
storytold:mainfrom
harrisonoconnorhover:codex/spanish-formulas
Oct 10, 2026
Merged

h-a-n-a-s-h-i merged 1 commit into
storytold:mainfrom
harrisonoconnorhover:codex/spanish-formulas

Conversation

@harrisonoconnorhover

@harrisonoconnorhover harrisonoconnorhover commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #45.

Selecting Español in View → Interface language controls formula entry, display, autocomplete and argument hints. Spanish mode uses the supported function table, semicolon arguments, decimal commas and backslash array columns; =SI(VERDADERO;SUMA(1,5;2,25);0) is stored as IF(TRUE,SUM(1.5,2.25),0). English mode retains English names and separators.

This uses the existing persisted UiState.language. The formula bar, cell editor, Show Formulas, Insert Function and Formula ribbon follow that setting. Canonical engine edit templates, including AutoSum and incomplete function openings, are localized when they reach the editor; typed input is not translated twice. Defined/table names and LET/LAMBDA bindings retain precedence. Engine/API/CLI, clipboard exchange and XLSX syntax remain canonical English.

Rebased directly onto main e72e16a0eccc5b8354945e0c1e9b848dda1d9299 after #31, #104 and #82 merged. There is no remaining dependency stack. Upstream Portuguese translations, contextual labels, lenient saved preferences, language-command aliases and other UI changes are retained. Ten common Spanish mappings form the initial function table; other functions and formula locales retain their documented English fallback.

Validation:

  • 43 focused formula/UI tests pass, including a regression that failed before the template fix (=SUM( instead of =SUMA() and Portuguese fallback/persistence coverage. Existing tests cover names, decimal/array separators, text cells, autocomplete and actual XLSX save/reopen.
  • Rendered and inspected current native offscreen screenshots of the Spanish Formula ribbon/edit template, autocomplete/help, argument hints and language selector.
  • Native desktop cargo check --locked -p gridcraft, cargo xtask wasm, formatting, assets (34), layers (16) and diff checks pass.
  • Required cargo xtask ci stops at unchanged xlsx/src/sheet_read.rs:146 (collapsible_match). Scoped formula/UI Clippy stops at unchanged ui-egui/src/grid.rs:1657 (collapsible_match) and :1779 (overly_complex_bool_expr). The flagged code was compared against the base main commit; no findings originate in this patch.

Rendered GridCraft view from the offscreen UI test:

spanish-ribbon-template

@echelon

echelon commented Oct 10, 2026

Copy link
Copy Markdown
Member

Thank you — the parsing is careful (bounded recursion, names/LET bindings take precedence). Before merging we need to settle the localisation design: a hard-coded Spanish-only alias table that is always on (and ; accepted for every user) isn't the architecture we want long-term. We'd rather have a per-locale function-name table plus a list/decimal separator setting, with display/autocomplete/hints in the same locale (today a user types SI and sees IF). The i18n framework from #31/#104 is landing now — would you be up for reworking this on top of that locale setting?

If you haven't already, please come join us on Discord: https://discord.gg/artcraft — happy to talk any of this through there.

harrisonoconnorhover added a commit to harrisonoconnorhover/gridcraft that referenced this pull request Oct 10, 2026
@h-a-n-a-s-h-i
h-a-n-a-s-h-i merged commit 3e40014 into storytold:main Oct 10, 2026
@echelon

echelon commented Oct 10, 2026

Copy link
Copy Markdown
Member

Landed — thank you, Harrison! This rework is exactly what we were hoping for: Spanish names and ;/decimal-comma input follow the interface language, the engine, API, clipboard and XLSX stay canonical English, and the display round-trips losslessly.

I added a small maintainer fix-up on top (your branch doesn't allow maintainer edits, so it went straight onto main): English formula display now returns the stored text untouched rather than re-printing it every frame, Spanish formula detection no longer trims leading spaces (matching the engine's input_to_cell), plus a round-trip test for strings containing ,/;. Two small follow-up ideas if you're interested: the argument hint disappears while the cursor is inside an unclosed array constant (=SUM({1,2), and more Spanish function names beyond the first ten.

If you haven't already, please come join us on Discord: https://discord.gg/artcraft

h-a-n-a-s-h-i pushed a commit that referenced this pull request Oct 10, 2026
Add static pictures inside cells with XLSX roundtrip

Rebased onto main (conflicts with #83/#98 and main resolved by maintainer); the contributor's branch does not allow maintainer edits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

Feature request: Spanish-localized formula function names and separators

3 participants