Resolved
Resolved in: JetSmartFilters 3.2
Overview of the issue
When using the JetSmartFilters plugin to generate filters for JetEngine custom fields, the filter labels are not translated into secondary languages.
Workaround
Please make a full backup of your site before proceeding.
- Translate the labels using WPML → String Translation.
- Open the /wp-content/plugins/jet-smart-filters/templates/filters/checkboxes-item.php file.
- Replace the following snippet:
$checked_icon = apply_filters( 'jet-smart-filters/templates/checkboxes-item/checked-icon', 'fa fa-check' );
With:
$checked_icon = apply_filters( 'jet-smart-filters/templates/checkboxes-item/checked-icon', 'fa fa-check' ); $label = apply_filters('wpml_translate_single_string', $label, 'Jet Engine Admin Labels', 'Admin Label - '.$label );
- Then, open the /wp-content/plugins/jet-smart-filters/templates/filters/check-range.php file.
- Replace the following snippet:
foreach ( $options as $value => $label ) {
With:
foreach ( $options as $value => $label ) { $label = apply_filters('wpml_translate_single_string', $label, 'Jet Engine Admin Labels', 'Admin Label - '.$label );
- Check the labels on the front-end. They should be translated now on second languages
After plugin smartfilters update there is no second piece of code to change:
“foreach ( $options as $value => $label ) {”
How now I can make it work?
Thank you Denis for pointing this out.
We have updated the errata accordingly.
Hi! Thanks, as I mentioned also at my ticket the problem is more huge. That snippet changes strings on frontend, but filter doesn’t work because it getting first language values and tries to filter.
Example:
http://theleadersestate.devispace.pl/en/real-estate/
Try to tick something at real estate filter and click filter. At link we will see that it trying to filter via polish value, not english as it should be.
Also at my another ticket i mentiond another problem, but it seems that it’s error of jetengine more than jetsmarfilters.
Translating of only checkbox fields don’t work properly. With all others as select for example it works perfect
Hello Denis,
Could you please create a ticket in our forum with the details? Please also mention this errata.
We would like to do some tests, maybe it’s a different issue.
Yep, i have 2 open tickets
The jet smart filters labels can be translated, but the checkbox custom fields can not be translated.
It seems like a different issue from the one reported here, could you please open a report in our forum?
https://wpml.org/forums/topic/i-can-not-translate-the-jet-smart-filters-custom-fields-built-with-jet-engine/
I already opened a ticked here.
Perfect!