Issue
We have a search page with several facets. One of them is the "Custom Facet" widget.
How can we translate the Custom Heading of a Custom Facet, to display in multiple languages on our site?
The configuration page of this custom facet only allows for single-language input, so it is not possible to translate it.
Environment
- Quarterly Release
- 2024.Q1
Resolution
Unfortunately, this custom facet does not allow direct internationalization of its title.
However, as a workaround, you can use translation keys for the "Custom Heading" field to automatically display it in the user's language.
To manage translation keys (view existing or add new ones), navigate to the Control Panel > Configuration: Language Override functionality.
As an example, using this workaround, you can do the following:
- Configure the Custom Heading with the value
hello-world
- Go to Control Panel > Configuration > Language Override and add the
hello-world
translation key with the values:-
Hello world
(en-US language) -
Hola mundo
(es-ES language)
-
- Check the behavior of the search page in English and Spanish:
- If you execute a English search, the HELLO WORLD header is shown
- If you execute a Spanish search, the HOLA MUNDO header is shown
Additional Information