Skip to content

fix(core): Localize default collection filter names#4915

Open
grolmus wants to merge 1 commit into
vendurehq:masterfrom
grolmus:mgrolmus/oss-449-core-add-missing-translations-for-default-collection-filter
Open

fix(core): Localize default collection filter names#4915
grolmus wants to merge 1 commit into
vendurehq:masterfrom
grolmus:mgrolmus/oss-449-core-add-missing-translations-for-default-collection-filter

Conversation

@grolmus

@grolmus grolmus commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

Localizes the default collection-filter names shown in the Dashboard. The collection-filter ConfigurableOperationDef labels/descriptions in @vendure/core were English-only, so the "Add collection filter" dropdown options and the arg labels inside a filter card stayed in English even when the Dashboard UI language was switched.

This is the server-side complement to OSS-405 (#4410): that PR fixed the dashboard-owned strings, but the filter names/labels are served by core via the collectionFilters query and resolved server-side by languageCode, so they can only be translated here.

Root cause

In packages/core/src/config/catalog/default-collection-filters.ts, the user-facing label/description fields are LocalizedString[] that only defined LanguageCode.en. When the dashboard requests collectionFilters with e.g. languageCode: de, the resolver falls back to the English value.

Change

Expanded the 9 short user-facing strings to include the 26 locales the Dashboard ships (en + de, es, fr, it, nl, pt_BR, pt_PT, cs, pl, ro, hr, hu, nb, sv, tr, uz, ru, bg, uk, ar, fa, he, ja, ne, zh_Hans, zh_Hant):

  • Filter descriptions: "Filter by facet values", "Filter by product variant name", "Manually select product variants", "Manually select products"
  • Arg labels: "Combination mode", "Facet values", "Contains any", "Product variants", "Products"

The apply() query-builder logic is untouched.

Scope notes

  • Two long arg tooltip descriptions (combineWithAnd, containsAny) are intentionally left English-only: translated, they exceed the eslint max-len (170) in verbose languages after prettier reformatting, which would require a // eslint-disable per line. Tracked as a follow-up. (Result: a de user sees a German label with an English hover tooltip on those two args.)
  • Collection filters are intentionally the only configurable operation localized inline here. Promotions/shipping/payment configurable-ops remain English-only; a broader extraction of all such strings into lingui catalogs is proposed separately in OSS-560 rather than inlining everywhere. This PR is the targeted fix for the collection-filter UI.

Test plan

  • tsc on default-collection-filters.ts: no errors; all 26 codes are valid LanguageCode members.
  • eslint clean; prettier reports the file already conforms.
  • No behavioural/query logic changed — the diff is data (LocalizedString entries) only.

Relates to OSS-449. Complements #4410 (OSS-405).


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.

The default collection-filter ConfigurableOperationDef labels and
descriptions in default-collection-filters.ts were English-only. These
strings are served to the Dashboard via the collectionFilters query and
resolved server-side by languageCode, so the collection-filter dropdown
names and arg labels never translated (the server-side half of OSS-405).

Add translations for the 9 short user-facing strings across the 26 locales
the Dashboard ships. The two long arg-tooltip descriptions are left in
English (they would exceed the eslint max-len limit in verbose languages);
tracked as a follow-up.

Note: collection filters are intentionally the only configurable operation
localized inline here; a broader extraction of all such strings to lingui
catalogs is proposed separately in OSS-560.

Relates to OSS-449
@vercel

vercel Bot commented Jul 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
vendure-storybook Error Error Jul 2, 2026 1:47pm

Request Review

@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 94e05392-4805-4959-869a-03e84eb1f4e5

📥 Commits

Reviewing files that changed from the base of the PR and between 32d4746 and 758a983.

📒 Files selected for processing (1)
  • packages/core/src/config/catalog/default-collection-filters.ts

📝 Walkthrough

Walkthrough

This PR updates default-collection-filters.ts by converting single-language (en-only) UI label and description fields into multi-language arrays keyed by LanguageCode. Affected entities include combineWithAndArg, facetValueCollectionFilter, variantIdCollectionFilter, productIdCollectionFilter, and the exported facet-value-filter, variant-name-filter, variant-id-filter, and product-id-filter configurations. No filtering or query-building logic changes.

Changes

File Summary
packages/core/src/config/catalog/default-collection-filters.ts Converted en-only label/description fields to multi-language arrays across collection filters and their arguments.

Possibly related issues

Suggested reviewers: BibiSebi

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: localizing default collection filter names.
Description check ✅ Passed Covers summary, root cause, change, scope, and test plan, and references the related issues.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@grolmus grolmus requested a review from michaelbromley July 2, 2026 13:50
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