Repository navigation
feat(html): type and show function names in the language of the document - #1242
Merged
Merged
Conversation
- `formula::localized_functions` and `english_functions` turn the names of a formula into the ones LibreOffice shows in the language of a locale and back. A name counts ahead of `(`, outside a text and a quoted sheet name. The match ignores the case of ASCII letters. - `tools/formula/generate_function_names.py` writes the table from the LibreOffice translations at a pinned commit: 1526 names of the functions the evaluator implements, in the 16 languages of the boolean words. - `toFile` and `toInput` of the module take the locale of the page, so a German user types `=SUMME(A1;B1)`, the file states `SUM`, and the cell opens as `=SUMME(A1;B1)`. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017QtawyvLP2SCnoBtnVfFed
- `localized_functions` and `english_functions` are defined as `formula::…` in the reopened `odr::internal`, as AGENTS.md asks, so a signature that drifts from the header fails to compile. - The design doc wraps its paragraph on function names. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YHNzLmVv1mFWfPitHASucN
andiwand
force-pushed
the
feat/formula-localized-names
branch
from
October 24, 2026 17:26
1dd496a to
3a30b8f
Compare
andiwand
added a commit
that referenced
this pull request
Oct 24, 2026
The brotli'd `odr-core.wasm` grew slowly to the 1.5 M ratchet. The last green commit on main (5ae95b9) measures 1,573,966 bytes locally, so no single change crossed it. Main now measures 1,590,514 bytes, and the localized function names (#1242) add about 16 K. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017QtawyvLP2SCnoBtnVfFed
andiwand
added a commit
that referenced
this pull request
Oct 24, 2026
The brotli'd `odr-core.wasm` grew slowly to the 1.5 M ratchet. The last green commit on main (5ae95b9) measures 1,573,966 bytes locally, so no single change crossed it. Main now measures 1,590,514 bytes, and the localized function names (#1242) add about 16 K. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017QtawyvLP2SCnoBtnVfFed
andiwand
added a commit
that referenced
this pull request
Oct 24, 2026
The brotli'd `odr-core.wasm` grew slowly to the 1.5 M ratchet. The last green commit on main (5ae95b9) measures 1,573,966 bytes locally, so no single change crossed it. Main now measures 1,590,514 bytes, and the localized function names (#1242) add about 16 K. Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
🤖 Generated with Claude Code
The last of the spreadsheet leftovers: localized function names, for input and display, as agreed. A German user types
=SUMME(A1;B1), the file statesSUM, and the cell opens as=SUMME(A1;B1). It is rebased onmainwith #1240 and #1241.What
tools/formula/generate_function_names.pywritesformula_function_names.cppfrom the LibreOffice translations (source/<language>/formula/messages.po, MPL-2.0) at a pinned commit, astools/pdfdoes for its data. It keeps the entries ofRID_STRLIST_FUNCTION_NAMESfor the functions the evaluator implements: 1526 names in the 16 languages ofnumber_format::boolean_words. The cachetools/formula/po/is ignored. Excel's names can differ from LibreOffice's, so the table follows LibreOffice.formula::localized_functions(formula, locale)andenglish_functions(formula, locale)work on the text:(, outside a text and a quoted sheet name.ZÄHLENWENNcould not be mapped on the tree.pt-BRhas its own table, andnomaps tonb.zählenwenndoes not matchZÄHLENWENN.TIMEforHOUR, but then that function shows translated too (TID). No two functions share a translated name. An English name typed into such a language reads as LibreOffice reads it there:TIMEisHOURin Danish.toFileandtoInputtake the locale of the page (data-odr-locale). An xlsx states none, so it stays English.Test
FormulaWriter.a_function_name_takes_the_language_of_the_document: German and French, English input that stays, a name in a text and in a quoted sheet name that stays, a language without a table, andno.formula.test.mjs:toFileandtoInputin German, Austrian German and French, and in Japanese, which keeps English. The node suite passes (82 tests).formula-input.html(32 checks): the German page opens a formula cell as=SUMME(A1;B1)*1,5and=STABW.S(…), and=summe(A1;B1)*1,5typed in lower case writesof:=SUM([.A1];[.B1])*1.5.