Skip to content

fix(report): German filters and summary in a German HTML report - #948

Merged
eizedev merged 22 commits into
mainfrom
fix/report-german-describe
Nov 25, 2026
Merged

eizedev merged 22 commits into
mainfrom
fix/report-german-describe

Conversation

@eizedev

@eizedev eizedev commented Nov 25, 2026

Copy link
Copy Markdown
Owner

Summary

A German HTML report now writes its filters and its summary in German. Before this change, describeView had English words only.

Fixes #798

The Year is is 5 phrase for op: "=" was already fixed on main by #869, so this PR does not touch it.

pivotkit-core

  • describeView(view, data, { locale, labels }) writes English or German.
    • Whole phrases with placeholders per language.
    • Counted forms follow the language's plural rules.
    • Numbers and quotes follow the locale: 2,5, „North“.
  • German writes:
    • value lists with "; ", because the decimal mark is a comma;
    • filters joined by "; und ";
    • booleans as Ja/Nein;
    • one-unit ranges as heute / gestern / im Vorjahr.
  • Anchored ranges name the unit around the anchor.
  • New helper describeLabels(locale, own) with the table DESCRIBE_LABELS.
  • labels and own are checked:
    • unknown keys, words of the wrong kind and a bad lang throw;
    • every plural category of the language is accepted;
    • the result is a frozen copy.
  • English output is unchanged word for word. I checked this on more than 80,000 generated views against main. The one exception is a fix: a rolling range (calendar: false) no longer says "current excluded", because the engine ignores includeCurrent there.

pivotkit-report

  • render writes {{filters}} and the summary in the locale's language.
  • New option describeLabels. A host passes its own words with it, merged over the locale's words or over the language its lang names.
  • In German, filters in {{filters}} are joined by "; und ", so they stay apart from their value lists. The English line is byte-identical.

pivotkit-element

  • The German words load with the report group, not with the first load. A build test checks this.
  • First load: 178.9 KiB gzip (budget 182.5).
  • Report group: 29.7 KiB (+3.4 KiB). I raised its budget to 29.7 KiB, measured with Node 24 as in CI.

Neutral review

I ran three rounds of independent review on the local branch before pushing, then a targeted check of the last fixes. Fixed because of them:

  • the words stay out of the first load;
  • a host can pass words in another language;
  • no nested brackets in German;
  • one-unit and anchored ranges say exactly what the engine keeps;
  • German numbers, quotes, lists, booleans and filter joins are unambiguous;
  • the wrong "current excluded" for rolling ranges is gone;
  • partial describeLabels merge over the locale's words;
  • words are checked by kind, with every plural category accepted;
  • docs rows in core.md, report.md and localisation.md.

The last round found nothing blocking.

Left for follow-up issues:

  • describeLabels cannot be passed through pivotkit-react's Export.
  • English "in the this year" and "in the before 2 days" read badly; that text is older than this PR.
  • "(gleitend)" for direction "this".

Checklist (PRODUCT.md)

  • Linked issue
  • New or changed tests fail without this change; no test weakened
  • Docs and CHANGELOG.md (core, report, element) describe the new state
  • Reviewed before opening by a separate AI session

Test plan

  • npm run lint, npm run types, npm test, npm run growth, npm run pack:check: exit 0
  • Full npm run test:browser on the state before the last fix round: 2792 passed. Two webkit tests failed because the browser closed during the run; they passed on rerun.
  • After the last fixes, report, export, PDF, template, theme, phone and element specs in chromium, firefox and webkit: 462 passed

🤖 Generated with Claude Code

eizedev and others added 22 commits November 25, 2026 16:44
- describeView(view, schema, { labels }) takes the words of its texts. DESCRIBE_LABELS holds
  English and German as whole phrases with placeholders, so each language keeps its word order;
  describeLabels(locale) picks one. A key that labels leave out stays English.
- German takes the aggregator names from REPORT_LABELS and the grouping units from GROUPING_NAMES.
- Each phrase is built from the words first and filled once with the view's names and values, so a
  name that looks like a placeholder stays as it is.
- English is unchanged, word for word: the MCP server and the CLI keep it.

Refs #798

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

render passes the words of the report's language to describeView, so {{filters}}, {{summary}}
and the page description follow the locale as the report's other words do.

Refs #798

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

- The ranges take their units from RELATIVE_UNITS. A test checks that every relative unit and
  direction, comparison, precision, text rule and chart type has words in both languages, and that
  English reads as before.
- A table that labels give in part keeps English for its other entries.
- The growth baseline keeps the docs line total of main.

Refs #798

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refs #798

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

# Conflicts:
#	packages/pivotkit-core/CHANGELOG.md
#	packages/pivotkit-report/CHANGELOG.md
describe-labels.js is re-exported by pivotkit-core's index.js, so the
element's first load carried the German words of the HTML report's
filters and summary. Its export line joins BARREL_OFF.report: only the
report's chunk reaches it.

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

- No parentheses inside parentheses: ", ohne leere Werte", "Filter: ...".
- One whole unit of a relative range named as the engine keeps it:
  "heute", "gestern", "morgen", "im Vorjahr"; rolling ranges say
  "innerhalb des letzten Tages".
- German quotes for text values; options.locale writes numbers as the
  locale does, without grouping. English stays word for word.
- Top and bottom, columns, value filters and invalid views in plain German.
- labels merge at every depth; labels that are not an object throw
  INVALID_OPTION; DescribeLabelsInput types the nested partial tables.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A host that passes its own labels passes describeLabels too, so the
report keeps to one language. By default both follow the locale. The
filters and the summary write numbers as the locale does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…the unit around it

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The German words of describeView load with the report group: 29.2 KiB
gzip on an official Node 24 build.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…unambiguously; no "current excluded" for a rolling range

German separates a list's items with "; " so a decimal comma stays in its
number, joins filters with "; und " after their blanks clause, and writes
true and false as Ja and Nein. A rolling range (calendar: false) no longer
says the current unit is excluded in either language: the engine ignores
includeCurrent there. describeLabels(locale, own) puts a host's words over
the locale's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A German report with a partial describeLabels mixed English into its
filters and summary.

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

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ys and words of the wrong kind

Each word must have the kind of the same key in DESCRIBE_LABELS (a text,
or a table of the same shape), and lang must be a language tag. A wrong
word gave "(undefined)" or was ignored. Adds the filterList label for a
list of filters alone; describeLabels' result is frozen.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…art from their lists

German list items use "; ", so the filter line joined both with one mark.
The English line is unchanged. describeLabels with a wrong word throws
INVALID_OPTION before any work.

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

wordsProblem refused few, many, two and zero in a table of forms by
count, though lang picks them by Intl.PluralRules. A host's table placed
where the base had a text or null was kept by reference and unfrozen.
core.md documents and and filterList.

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

# Conflicts:
#	packages/pivotkit-element/build.js
#	packages/pivotkit-report/CHANGELOG.md
@eizedev
eizedev merged commit b8ff510 into main Nov 25, 2026
26 checks passed
@eizedev
eizedev deleted the fix/report-german-describe branch November 25, 2026 21:46
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.

report: German filters and summary in a German HTML report

1 participant