I would like to know what would be solution to get custom field value (the official Joomla solution https://docs.joomla.org/J3.x:Adding_custom_fields/Multilingual_Sites) as translation in filters module selection. Now I get raw value without Text::_('').
Support
Multilingual content in the JFilters component
Public
Closed
Latest post by polovsek on Tuesday, 11 July 2023 18:56 EEST
polovsek
sakinho
Hi
The link you posted refers to translating the custom field's title/label and description.
The filter's title is translatable. So you can use a language constant there.
If you want to translate a filter value, you will probably have to do it through a template override of a module's sub-layout.
If you are just using links, checkboxes and radio buttons, the sub-layout that needs overriding is: tmpl/_dummy_elements.php
The value's label is printed in line 100
htmlspecialchars($option->getLabel());
Just replace it with:
htmlspecialchars(\Joomla\CMS\Language\Text::_($option->getLabel()));
Kind regards,
Sakis Terzis
Founder and Lead Developer
polovsek
Works great... tmpl/_dummy_elements.php fix worked.