Repository navigation
Conversation
README: the app icon above the title
The grid showed every number and date in en-US conventions: 1,169.00 and 1/1/2024 where Excel on a Swiss Mac shows 1'169.00 and 01.01.2024. numfmt gets a Locale (decimal and digit-group separators, the short date) from a language tag, matched by region first so macOS's en-CH gets Swiss formats. format_value_in renders a format's `.` and `,` in the region's separators and the built-in short date (m/d/yyyy, 14; with time, 22) as the region's; format_value stays en-US. Only the grid uses it (GridState::number_locale; the app and the snapshot example take the system's, snapshot also --locale). Input, the editor, files, commands, CSV and TEXT() stay en-US. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pick2510
force-pushed
the
feat/regional-display-formats
branch
from
October 22, 2026 13:00
910c4f1 to
b30ca72
Compare
The grid shows built-in dates and separators in the system region, but AutoFit measured the en-US text, so a wider regional date (01.01.2024 vs 1/1/2024) could still show ####. The display region now lives on the session (Session::display_locale, replacing GridState::number_locale); the grid draws with it and AutoFit measures with it (display::cell_text_in). Commands, files and agents stay en-US. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
|
Superseded by storytold#2263 (same branch, opened upstream). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The grid showed every number and date in en-US conventions,
1,169.00and1/1/2024, where Excel on a Swiss Mac shows1'169.00and01.01.2024. In a private corpus of real workbooks (not committed), every amount and date differed from Excel because of this.numfmt::Localeholds the decimal and digit-group separators and the short-date code.Locale::from_tagreads a tag such asde-CH,en_CHorfr_FR.UTF-8, and matches by region first: macOS reportsen-CHfor English with Swiss formats. Regions covered: CH/LI, DE/AT/LU, FR, GB/IE, IT/ES/BR, NL, JP, CN; anything else is en-US.format_value_inshows a format's.and,with the region's separators (number, General, scientific and fraction sections; quoted literals untouched), and the built-in short date (m/d/yyyy, number format 14, andm/d/yyyy h:mm, 22) as the region's short date.format_valuestays en-US.GridState::number_locale. The app and thesnapshotexample take the system's region, andsnapshotalso accepts--locale. Input, the cell editor, files, commands/MCP, CSV andTEXT()stay en-US, so agents and scripts see the same text on every machine. Localized input is a separate step (Feature request: Spanish-localized formula function names and separators storytold/gridcraft#45).docs/localization-parity.md: the stale "en-US only formats" line is corrected (PR de-DE language support: German interface, numbers and formulas storytold/gridcraft#163 was closed).Tests (built in code)
numfmt::tests::regional_display_formatscovers:1'169.00,01.01.2024, the date with time, and the Accounting format;1.234,50, a quoted.kept as a point, General0,5, scientific1,23E+06, a fraction with a grouped whole part;en_CHequalsde-CH);format_valuestill en-US.ui-egui/tests/regional_formats.rs: a grid inen_CHpaints1'169.50and01.01.2024(with the stored code stillm/d/yyyy),de-DEpaints1.169,50and0,25, and the default paints en-US.CI
cargo xtask ci: fmt, clippy, assets, layers, wasm, parity and keytips pass, and every test passes except the pre-existingheader_autofit::table_filter_autofit_works_through_command_and_header_double_click. That test fails identically onmainon this machine with Carlito installed (see #1).🤖 Generated with Claude Code