Open
Description
UI display formatting follows strings.locale, but numeric input parsing does not. This is a follow-up to #6 and is separate from the translation and optional-language bundling work.
Current behavior:
src/core/xlsx/editor.ts(parseInput) recognizes decimal dots only. With German UI/formatting (strings.locale = 'de-DE'), entering1,5in a spreadsheet cell stores text rather than the numeric value1.5.src/react/edit/Toolbar.tsx(SizeBox) usesparseFloat. An input such as12,5can silently become12instead of12.5.- Translated labels and localized number display therefore do not imply localized input support.
Reproduce:
- Import the German table from
@p10node/office-engine/locales/deand pass it asstringsto an editable viewer. - Enter
1,5in a spreadsheet cell and inspect its saved type/value: it is text. - Enter
12,5in a font-size field and commit: the parser can truncate at the comma.
Expected behavior / acceptance criteria:
- Parse numeric user input according to the active
strings.locale(for example,1,5inde-DEand1.5inen-USboth produce the numeric value1.5). - Apply the same parsing rules consistently to spreadsheet numeric/percentage input and editable numeric controls such as font size.
- Validate the entire input; reject invalid or ambiguous separators rather than silently accepting a prefix.
- Define and document grouping-separator behavior, including locale-specific spaces, and distinguish grouping from decimal separators.
- Preserve canonical OOXML numeric storage and formula syntax; changing the UI language must not reinterpret existing workbook values or rewrite stored formulas.
- Cover decimal-dot/comma locales, percentages, grouping/ambiguity, invalid input, and saved-value round trips with focused tests.
Formula-entry localization (localized function names or argument separators) can be scoped separately; it should not be conflated with UI number parsing.
Metadata
Metadata
Assignees
Labels
No labels
Activity
fix(toolbar): a decimal comma in the font size is a decimal point