Skip to content

German formulas, numbers and dates as Excel 365 de-DE shows them (builds on #443) - #1201

Open
Herr-Enklo wants to merge 7 commits into
storytold:mainfrom
Herr-Enklo:feat/german-formulas
Open

Herr-Enklo wants to merge 7 commits into
storytold:mainfrom
Herr-Enklo:feat/german-formulas

Conversation

@Herr-Enklo

Copy link
Copy Markdown

Builds on #443 by @quantmind-br (the formula dialect mechanism; its commit is kept as-is) and makes German match a running German Excel: formulas, cell values, numbers and dates.

Observed, not looked up

Every German word was observed black-box. I used Excel 365 with a German UI and the de-DE regional format, through its automation interface: a canonical formula in, Formula2Local out, on synthetic workbooks that were never saved.

What was observed:

  • all 514 GridCraft functions, plus GETPIVOTDATA, IMAGE, TRANSLATE, DETECTLANGUAGE, and a real Data Table's TABLE
  • the booleans, error values, separators, array constants and table specifiers

The file header documents this the way #674 does.

What it changed in #443's German table:

  • MAP stays MAP in German Excel; M12: formulas in German, Brazilian Portuguese, Russian and French, full Spanish table #443 had ZUORDNEN.
  • German Excel shows #CALC!, not #KALK!. Both =LAMBDA(x;x) and an empty FILTER display #CALC!.
  • 17 names were missing: the PROGNOSE.ETS family, UNREGER/UNREGLE, PROZENTVON, ABSCHNBEREICH, the REGEX functions, PIVOTDATENZUORDNEN, BILD, ÜBERSETZEN, SPRACHEERKENNEN.
  • TABLE is MEHRFACHOPERATION: {=MEHRFACHOPERATION(B1;B2)}.
  • Errors #WERT!, #BEZUG!, #ZAHL!, #NV, #DATEN_ABRUFEN and #ÜBERLAUF! are confirmed.
  • Specifiers are #Alle, #Daten, #Kopfzeilen, #Ergebnisse. [#Diese Zeile] is accepted when typed and shown as @.
  • New: [@[A]:[B]] now parses and prints; Excel shows it, and GridCraft couldn't parse it at all. Files keep the long form.
  • crates/formula/tests/german_observed.rs checks all 519 observed pairs in both directions.

Formula words on more surfaces

  • M12: formulas in German, Brazilian Portuguese, Russian and French, full Spanish table #443 already covers the formula bar, cell editor, Show Formulas, AutoComplete and Insert Function.
  • This PR adds:
    • Dialog formula fields: Name Manager, data validation (sources such as Ja;Nein, bounds such as 1,5, custom formulas), conditional-format values and formulas, calculated fields.
    • Cell values: cells show booleans and errors in the language (WAHR, #NV), and typing those words enters the value.
  • As in German Excel, typed TRUE, #N/A and 10/13/2026 become text.

German numbers and dates

  • A small NumberLocale in core (L0) holds the region's data, observed for de-DE. It drives display (numfmt format_value_in) and typed input (core parse_input_in).
  • Display, as German Excel shows it:
    • numbers: 1.234,56
    • dates and times: 13.10.2026, 01.03.2026 14:30, Dienstag, 13. Oktober 2026
    • German month and day names; ids 14–22 drawn the German way
  • Typed input: 1,5, 1.234,5, -3,2%, 1,5E+3, 5 €, 13.10.2026, 13.10.26, 13.10, 13. Okt 2026, 14:30, each with Excel's automatic format.
  • The UI enters typed values canonically through cell.set {autoFormat}.
  • Separators option: File › Options › Advanced › Use system separators, with decimal and thousands fields. It is a user preference and is never saved in the workbook.
  • Print, PDF and CSV: print and PDF show what the grid shows. In a German session, CSV is written with ; and German values; comma-separated files are still read as en-US.

Canonical boundary

Workbooks, format codes, TEXT(), the clipboard, engine commands, the CLI and MCP all stay canonical en-US/English. English sessions are unchanged; tests check that.

Behaviour change to note

With the dialect mechanism, Spanish, Portuguese and Russian sessions now also show their dialect's booleans and errors in cells, and typed English TRUE becomes text there, as in those Excels.

Not included

  • Format codes inside Format Cells (German Excel shows #.##0,00, TT.MM.JJJJ).
  • TEXT()/VALUE() format strings.
  • Number formatting in chart axis labels, filter lists and Find results.
  • R1C1 (Z1S1).
  • The ribbon's Currency button still uses $.
  • Other regions keep en-US numbers until they are observed.

Tests

  • Observed-pair tests for formulas.
  • About 90 observed German entries for typed input.
  • numfmt display tests; engine/tests/german_locale.rs.
  • UI: typing, editing, dialog fields, Options page.
  • CSV.
  • Fuzzing of German formula text, typed input and multi-byte separators.
  • cargo xtask ci: all 8 steps pass (1635 tests).

🤖 Generated with Claude Code

quantmind-br and others added 7 commits October 13, 2026 07:54
…sh table

The interface language picks the formula language, as in Excel. Each language is a data
table in crates/formula/src/input/<lang>.rs (function names, booleans, errors, structured
reference specifiers and separators) behind one Dialect, so the lexer, parser and display
printer take no per-language code:

- es (424 names), de (403), pt-BR (412), ru (459), each entry with its source; Microsoft's
  localized pages are machine-translated, so a name needs two agreeing signals
- local error literals (#WERT!, #Н/Д, #¡VALOR!), longest match wins
- local table specifiers ([#Kopfzeilen], [#Эта строка]) and separators inside []
- German `.` between array columns; Russian `:` between array rows (no row ranges inside
  braces), merged with upstream trim references (A1.:.F10, 1.:3)
- LET/LAMBDA bindings and workbook names shadow local names case-insensitively in any script
- editor autocomplete and argument hints take Unicode names; Insert Function searches and
  sorts by the local name; help shows the local name with local separators
- Czech and French interfaces keep English formulas until they get a table

Files, clipboard, engine commands, CLI and MCP keep canonical English syntax.
Every German word in crates/formula/src/input/de.rs was observed in Excel 365 (German
interface, de-DE regional format) on 2026-10-13 through its automation interface:
each of GridCraft's 514 functions, plus GETPIVOTDATA, IMAGE, TRANSLATE and
DETECTLANGUAGE, was entered in canonical form and read back as German Excel shows it.
That confirmed 402 of storytold#443's names, corrected MAP (it stays MAP; storytold#443 had ZUORDNEN)
and added the 17 it was missing (PROGNOSE.ETS*, UNREGER.KURS and the other ODD*
functions, PROZENTVON, ABSCHNBEREICH, the REGEX functions, PIVOTDATENZUORDNEN, BILD,
ÜBERSETZEN, SPRACHEERKENNEN). 99 functions keep their English name.

The observation also settled the error values: German Excel shows #CALC! (not #KALK!
as Microsoft's help pages say) for =LAMBDA(x;x) and an empty FILTER, and #ÜBERLAUF!
for a blocked spill. [#Diese Zeile] is accepted when typed and shown as @, including
for a column range, so the parser and printer now read and write [@[A]:[B]] as Excel
does (files keep [[#This Row],[A]:[B]]).

crates/formula/tests/german_observed.rs holds the 518 observed pairs plus separators,
booleans, errors, arrays and table specifiers, and checks both directions: canonical
-> German equals Excel's text, and Excel's text reads back as the formula. A fuzz test
feeds random German fragments to the parser and printer.

The calc test that every table names a known function allows the four Excel functions
GridCraft doesn't compute yet, and fails once one of them is implemented.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
numfmt was en-US only. A small NumberLocale (crates/core/src/locale.rs) now travels
from the interface to where values are drawn or typed: a Region with its fixed
conventions (date order and separator, month and weekday names, how built-in formats
look) plus the decimal and thousands separators, which the user may override. de-DE
was observed in Excel 365 with the German regional format on 2026-10-13 through its
automation interface (typed entries read back with value and automatic format; values
drawn through each format code); every other region stays en-US until observed.

- numfmt: format_value_in draws `1.234,56`, `1234,56` (General), `13.10.2026` for id 14,
  `13. Okt 26`, `Okt 26`, `hh:mm` (ids 15-17, 20-22), German month and day names
  (`Mrz`, `Di`), `/` in date codes as the region's date separator, `[$-409]`/`[$-407]`
  tags choosing the names, and the system Long Date/Time tags. Codes stay canonical,
  TEXT() stays en-US, format_value is unchanged.
- core: parse_input_in reads `1,5`, `1.234,5`, `-3,2%`, `1,5E+3`, `5 €`, `13.10.2026`,
  `13.10.26`, `13.10` (this year), `1.13` (January 2013), `13. Okt 2026`, `Okt 26`,
  `13.10.2026 14:30` as German Excel does, and keeps `13.10.`, `1.00`, `$5` as text.
- engine: DisplayLocale (number locale + formula language) with format_in,
  value_text_in, cell_text_in, edit_text_in and formula_text_in; Session.display_locale
  (set by the interface, canonical for CLI/MCP) is what PDF/print and Save As
  CSV/TSV/Web Page use, so a print shows what the grid shows. cell.set and range.fill
  take an optional autoFormat: the interface parses German input itself and enters the
  canonical value with the format German typing picks.
- CSV: in a session whose decimal separator is a comma, a new CSV is separated by `;`
  (Excel's list separator there), values are written as displayed (`1234,5;WAHR`), and
  opening prefers `;` and reads German numbers, dates, booleans and errors. A
  comma-separated file is read as en-US whoever opens it; workbooks never change.

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

With the interface in German, everything a person types or reads follows German Excel,
while engine commands, files, CLI and MCP stay canonical.

- Cells, the formula bar, the editor's starting text, the status bar, number-format
  previews, Ctrl+; / Ctrl+Shift+; and the Page Layout and print previews show values in
  the regional format (`1.234,56`, `13.10.2026`) and booleans and errors in the formula
  language (`WAHR`, `#NV`, `#ÜBERLAUF!`).
- Typed constants are read with the regional format (crates/core parse_input_in) and
  entered through cell.set/range.fill with their canonical value and automatic format
  (autoFormat). `WAHR` and `#NV` are values; `TRUE`, `#N/A`, `10/13/2026` and `13.10.`
  stay text, as observed in German Excel. Spanish, Portuguese and Russian keep storytold#443's
  decimal-comma entry and en-US display.
- Dialog fields that hold formulas or typed values speak the formula language: Name
  Manager's Refers to (and its list), data validation sources (`Ja;Nein`), bounds
  (`1,5`) and custom formulas, conditional-format values and formulas, calculated
  fields. OK and the control channel's ui.dialog.confirm convert them to canonical.
- File › Options gets an Advanced section with "Use system separators"
  ("Trennzeichen vom Betriebssystem übernehmen") and the Decimal/Thousands separator
  fields (options.separators), kept in ui.json, never in a workbook. "System" is the
  interface language's regional format, which follows the system on first run.
- Every engine command run from the interface carries the display locale, so Save As
  CSV and PDF from a German window are German, and the same commands from the CLI are not.

Tests: crates/ui-egui/tests/german_interface.rs (typing, re-editing, English unchanged,
separators option and its persistence, CSV, dialogs, the Options page in German) and
regional.rs unit tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs/formula-input.md describes where the formula language now applies (dialog fields,
cell booleans and errors), the new Numbers and dates section (regional format, Use
system separators, built-in date formats, print/PDF and CSV) and what is not localized
yet; German's words are documented as observed in Excel 365 de-DE.
localization-parity.md, function-parity.md, decisions.md, README and ROADMAP are updated
with their Last updated lines and history rows.

Random German-looking input is fuzzed through parse_input_in and format_value_in (with
multi-byte separators); the Options page's Editing heading gets its German label.

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

A data table's TABLE formula (Data › What-If Analysis › Data Table) was observed in the
hidden German Excel: `Range.Table` gives `{=MEHRFACHOPERATION(B1;B2)}` and, with one input,
`MEHRFACHOPERATION(;B1)`. The German table lists it, so interfaces that show TABLE through
the formula language spell it as German Excel does; both forms are checked in
german_observed.rs. The calc test now allows Excel's names GridCraft doesn't compute as
functions (GETPIVOTDATA, IMAGE, TRANSLATE, DETECTLANGUAGE, TABLE) without failing when a
branch starts computing one.

- File › Options › Advanced: a character typed into the Decimal or Thousands separator
  field replaces the one in effect (the field used to need clearing first).
- The editor keeps en-US numbers and dates for formula languages without an observed
  regional format (Spanish, Portuguese, Russian) and only shows their words.
- German Export page text: CSV is "durch Trennzeichen getrennt", not "durch Kommas".

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