Skip Navigation

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Tagged: 

This topic contains 13 replies, has 2 voices.

Last updated by denisR-17 1 year, 7 months ago.

Assisted by: Nicolas V..

Author Posts
May 23, 2023 at 10:07 am #13696781

denisR-17

We have a problem with JetSmartFiltres translation. After translating the filters according to the instructions, the filters display correctly on the frontend but don't work properly.

Could the problem be that not all Travel Planners are translated? The client wants only those who can speak Italian to show up on the Italian site, so only those have been translated.
You can see it here: hidden link and here hidden link

There is also a problem with the 'Select Filter'. The placeholder and Custom Fields have not been translated. You can check it here: hidden link

I follow this instruction: https://wpml.org/errata/jetsmartfilters-smart-filters-custom-fields-are-not-translated-in-secondary-languages/

The site is now in the maintenance mode so I can provide temporary access to solve the problem.

Zrzut ekranu 2023-05-23 o 12.04.29.png
Zrzut ekranu 2023-05-19 o 14.54.32.png
May 23, 2023 at 3:35 pm #13701211

Nicolas V.
Supporter

Languages: English (English ) French (Français )

Timezone: America/Lima (GMT-05:00)

Hello,

Welcome to the WPML support forum. My name is Nicolas and I will be happy to help you today.

Yes, I'd like to request a temporary admin access (wp-admin) – preferably to a test site where the issue has been replicated – so I can further investigate. Because right now I can't access any of the links you shared but also I think I'll need to have a look at the backend to see how those filters are created and translated.

I will activate a private field for your next answer where you can provide that information safely (this field is only visible by you and the support team). Don't share your own admin account, create a new one that you will delete when we finish troubleshooting.

IMPORTANT: Before we proceed, please backup your site and database.

Also, please add the name of the filter I should work on, for example the one used for Travel Planners.

Thanks,
Nico

May 25, 2023 at 1:57 pm #13716971

Nicolas V.
Supporter

Languages: English (English ) French (Français )

Timezone: America/Lima (GMT-05:00)

Hello,

I'm not sure to fully understand the issue. So if I missed something please let me know:

1. I was following their documentation here: hidden link

But I couldn't see the secondary language column in "Smart filters" to be able to translate them. At the top of the screen there was a button "Switch to classic view". I clicked on it and now I can translate filters (see capture1 & 2).

2. So once I was able to translate (before doing any translation) I went to hidden link

But I could see that labels are already translated and also, I did a couple of queries and the filter seems to work well.
I'm not sure about "How many people" and "When" but when I filter by language I can see that the filter works (because of the flags on each planner).

That's why I'm not sure to understand the issue here.

3. Then I went to hidden link
In that case I could see that placeholders for dropdowns where not translated.
I went ahead and translated the first filter to "In quanti siete?" and it's showing correctly on the frontend (see capture 3).

I think that you only need to translate your filters now as I did for "In quanti siete?".

Nico

capture3.png
capture1.png
capture2.png
May 25, 2023 at 2:45 pm #13717381

denisR-17

Hello,

1. Filters for Travel Planner was translated in WPML → String Translation. And then I following those steps: https://wpml.org/errata/jetsmartfilters-smart-filters-custom-fields-are-not-translated-in-secondary-languages/ This solved the problem of front-end translation, but on my side the filters are not working properly. Take a look on video that I put on youtube -> hidden link

2. Just a minute ago I translated 3 filters for Boat Charters hidden link and the placeholders have been translated, but text in dropdown was changed from numbers and text to true/false.

I would appreciate your help on that cases.

Zrzut ekranu 2023-05-25 o 16.37.16.png
May 26, 2023 at 12:04 pm #13723011

Nicolas V.
Supporter

Languages: English (English ) French (Français )

Timezone: America/Lima (GMT-05:00)

Hello,

Thanks for the video.

I'll check those two points now. I'll get back to you with my findings.

Nico

May 26, 2023 at 12:59 pm #13723381

Nicolas V.
Supporter

Languages: English (English ) French (Français )

Timezone: America/Lima (GMT-05:00)

Hello,

I think I managed to solve both issues.

For the planners, custom fields were set as "Copy once" so they got copied over to italian when you translated them the first time. But we did some changes so I set those 3 fields to "Copy" that way they are copied every time you make an update. Then I updated the translation and it's working fine now.

For boats, the issue was different, you are using Filters in Italian and some options that are selected on the English version were not select on the italian filter.

Here is the full video: hidden link

Nico

May 29, 2023 at 8:58 am #13730115

denisR-17

Hi Nicolas,
my issue is almost resolved now.

I just recreate flags on each travel planner listing because they disappeared after fixing the filters but it was just dynamic visibility matter. It seems to work perfect now.

I still don't know why the Smart Filters for Boat Charter multiplied itself in italian version - I didn't create second filters for these three 'Select' Filters on Boat Charters. They were probably created after the translation was added the first time in Smart Filter. But anyway... after repeating your steps text on dropdown is still in english.

In Custom fields Setting these fields are marked as "Copy"(do-you-need-skipper and rental-period). These four phrases (yes, no, half day, full day) have been translated in WPML -> String translation.
What settings should I set to make the text display correctly on the front-end?

Zrzut ekranu 2023-05-29 o 10.52.12.png
May 31, 2023 at 11:21 am #13747027

Nicolas V.
Supporter

Languages: English (English ) French (Français )

Timezone: America/Lima (GMT-05:00)

Hello,

Let me have a look and I'll get back to you. Please don't make any changes on the site that could affect those filters and pages while I'm working on it.

Thanks,
Nico

May 31, 2023 at 12:46 pm #13747647

Nicolas V.
Supporter

Languages: English (English ) French (Français )

Timezone: America/Lima (GMT-05:00)

Hello,

I think I found the issue and I'd like to modify the code from the plugin itself. Something similar to the errata you shared but this time in the PHP template for "Select" (instead of "checkboxes-item").

For that I would need to have FTP access or even better an access to a staging copy of your site.

I will reactive the private field for your next answer.

Thanks,
Nico

May 31, 2023 at 12:52 pm #13747707

Nicolas V.
Supporter

Languages: English (English ) French (Français )

Timezone: America/Lima (GMT-05:00)

Another solution would be to replicate your site on our servers and work on that code safely.

For this, I need to temporarily install a plugin called “Duplicator” on your site.

Once the problem is resolved I will delete the local site. Let me know if this is ok with you.
https://wpml.org/faq/provide-supporters-copy-site/

Nico

May 31, 2023 at 11:28 pm #13750299

Nicolas V.
Supporter

Languages: English (English ) French (Français )

Timezone: America/Lima (GMT-05:00)

Hello,

The code I wanted to test works well on the copy I took.

Please create a full backup before you proceed

1. Open the file wp-content\plugins\jet-smart-filters\templates\filters\select.php
2. Find the following code at line 58:

foreach ( $options as $value => $label ) {

3. Add the following code just after it:

//WPML
        if (class_exists('SitePress')) {
            $label = apply_filters('wpml_translate_single_string', $label, 'Jet Engine Admin Labels', 'Admin Label - '.$label );
        }

PS: You can do the same for other type of fields such as radio if needed.

Nico

June 1, 2023 at 8:33 am #13751807

denisR-17

Hello Nico,

almost perfect. Translation works on two of the three filters. For some reason the filter "How many people are you" has not been translated.
Does it work on your copy of the site? It appears that the settings of these 3 filters on our site are identical.

To be clear: First, you removed the previous translations that were added to the filters? Because I don't see any more translations previously added in the "Smart Filters".

Zrzut ekranu 2023-06-1 o 10.32.14.png
June 1, 2023 at 10:47 pm #13758055

Nicolas V.
Supporter

Languages: English (English ) French (Français )

Timezone: America/Lima (GMT-05:00)

Hello,

I was able o get the label translation on your production site by adding the "?" (How many people are you?) that way it's exactly the same label in the filter and in the custom field created for your CPT.

Filter: hidden link
Custom field: hidden link

Nico

June 2, 2023 at 8:33 am #13759313

denisR-17

Ok, I see it now.
My issue is resolved now. Thank you!