Skip Navigation

Resolved

Resolved in: JetSmartFilters 3.2

Topic Tags: Compatibility

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.

  1. Translate the labels using WPMLString Translation.
  2. Open the /wp-content/plugins/jet-smart-filters/templates/filters/checkboxes-item.php file.
  3. 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 );
    
  4. Then, open the /wp-content/plugins/jet-smart-filters/templates/filters/check-range.php file.
  5. 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 );
    
  6. Check the labels on the front-end. They should be translated now on second languages

9 Responses to “JetSmartFilters - Smart filters custom fields are not translated in secondary languages”

  1. 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?

  2. 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.