Summary
Facets generated automatically from a product field (via the ProductIndexSchemaExtender) use the index field name as their label, word for word. The translated names of the product field are never used, so on multilingual solutions every language shows the same label, usually in the default language. The only way around it today is customizing the facet template and maintaining a separate translation key per facet per language, while those translations already exist on the product field. Automatic facets should show the product field's name in the language of the current context.
Acceptance criteria
Technical details
Validated against: DynamicWeb 10, Swift 2 (confirmed by DynamicWeb support: https://doc.dynamicweb.com/forum?ThreadID=101711&PID=1605)
Feature flag / config: "Use as facet" enabled on a product category field; product index built with ProductIndexSchemaExtender
Root causes
- The automatic facet takes the index field
Name verbatim and holds no reference back to the source product field or its translations.
Proposed changes
- Keep a reference from the index field / automatic facet to the source product field, and resolve the facet label at render time through that field's translation for the current language, falling back to the index field
Name.
Existing code to reuse
- Existing product field name translations managed in the backoffice
Alternatives rejected
@Translate(facet.Name) in the facet template plus translation keys per language: works, but requires a template customization and duplicates translations that already exist on the product field
- Separate facet groups per language: loses automatic faceting and multiplies configuration
Summary
Facets generated automatically from a product field (via the ProductIndexSchemaExtender) use the index field name as their label, word for word. The translated names of the product field are never used, so on multilingual solutions every language shows the same label, usually in the default language. The only way around it today is customizing the facet template and maintaining a separate translation key per facet per language, while those translations already exist on the product field. Automatic facets should show the product field's name in the language of the current context.
Acceptance criteria
Technical details
Validated against: DynamicWeb 10, Swift 2 (confirmed by DynamicWeb support: https://doc.dynamicweb.com/forum?ThreadID=101711&PID=1605)
Feature flag / config: "Use as facet" enabled on a product category field; product index built with ProductIndexSchemaExtender
Root causes
Nameverbatim and holds no reference back to the source product field or its translations.Proposed changes
Name.Existing code to reuse
Alternatives rejected
@Translate(facet.Name)in the facet template plus translation keys per language: works, but requires a template customization and duplicates translations that already exist on the product field