Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
The client is using the 'Motors' theme with WPML to build a multilanguage website and has set the 'Listing' post type to 'non translatable' so that listings are available in all languages. However, when taxonomies are translated, filters do not show listings created in other languages.

Solution:
We recommend ensuring that listings in all languages have the taxonomy terms linked to them. If a listing is created in German with the term 'Weiß', it should also include the English term 'White' to appear when filtering by 'White'. If the post type is set to 'Don't Translate', it's usually best to set the taxonomy to 'Do Not Translate' to avoid synchronization issues. Alternatively, you can set the translation preference for the 'Listing' post type to 'Translatable - use translation if available or fallback to default language'.

For automatic translation of listings, WPML does not support automatic duplication, but you can enable automatic translation. Refer to the guide on automatic translation.

If you decide not to translate taxonomies and instead use String Translation for terms like 'White', ensure that the translations are consistent across the site. If you cannot find certain strings, check the Admin Screens section or use the String Translation documentation. For registering individual strings, the wpml_register_single_string hook might be necessary.

Please note that this solution might be irrelevant due to being outdated or not applicable to your case. If the issue persists, we highly recommend checking related known issues at WPML known issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If needed, do not hesitate to open a new support ticket for further assistance. You can reach out to us on the WPML support forum.

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 5 replies, has 2 voices.

Last updated by Prosenjit Barman 8 months, 3 weeks ago.

Assisted by: Prosenjit Barman.

Author Posts
May 6, 2024 at 7:08 am #15595233

sergiyY

Hello.

I'm building the multilanguage website on the "Motors" theme, which is compatible with WPML.
I need that the user can create a listing on any language, and this listing should be available in all language versions. In the WPML settings I switched the "Listing" post type to "non translatable", and, in general, it works fine: all listings are available for all languages.

However, I have problems with taxonomies/filters. If my taxonomies are not translated, filters work fine. But, if I translate taxonomies, filters don't work properly.

Let's say, the listing has "Color" option with the taxonomies "White" and "Black" for the default language (English). I have English and German versions of the website, and I translated "Color" options to German (White->Weiß, Black->Schwarz).
If I open the page with the all listings on the English version of my website, I can see listings created with the German version, and "Color" option is translated properly into English. However, when I use "Color" filter and choose, for example, "White" option, I can see only listings created with English version. If the listing is created with German version ("Color" was set as "Weiß"), it is not shown.

I'm not sure if this is the correct behavior of the WPML/theme, but that's not make sense to me. If all listings are shown on all languages, filters should also work for all languages. How it can be fixed?

Thank you.

May 7, 2024 at 10:51 am #15601294

Prosenjit Barman
Supporter

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hello There,
Thanks for contacting WPML Support.

I understand the issue you're experiencing. Based on what you've described, the "Listing" post type is set to "Don't Translate," which means the listings should appear across all language versions of the site. However, the taxonomies within these listings, like "Color", are set to "Translate".

This setting means that each taxonomy can have a version in each language. However, it appears that when you filter by a taxonomy term like "White", the filter only returns listings that are tagged with the English version of the term "White".

To address this, you should check whether the listings in the German language have the "White" taxonomy term linked to them. If not, you might need to manually add or link these terms to the German version of the listing.

Try updating one of the German listings to include the English taxonomy term "White" and see if it then appears when filtering. This could help identify if the issue is due to the way taxonomy terms are linked.

In the case of taxonomy translation settings, it's generally advisable to follow the settings of your taxonomy with those of the post type. If the post type is set to "Don't Translate," then it's usually best to also set the taxonomy to "Do Not Translate." Translating taxonomies while leaving the post type non-translatable can lead to synchronization issues, as the plugin will not be able to properly align the translated taxonomies with the universal posts across different language versions. I hope you can understand.

Let me know the update. I will be happy to help if you need further assistance in this matter.

Best regards,
Prosenjit

May 7, 2024 at 1:23 pm #15602264

sergiyY

Hi Prosenjit,

Thanks for your reply.

Yes, I can understand the logic. But it is still critical for me to have non-translated listings and translated taxonomies. Can you please provide me with more details about linking taxonomies' translation? Is there any manual about this? As I understand this, my translations are linked (see the screenshot attached (it's not about colors, as it was just an example to understand the case better). Or it should be linked additionally in some other way?

Also, if linking don't work, is there any workaround solution for my case? I was thinking about making the listing translatable and duplicate automatic listings into other languages. E.g. the user creates the listing in English, it is duplicated into German, so I'll have 2 versions of the listing for different languages and should not have this problem with taxonomies translation. So the question is there any way to duplicate the listing into all languages automatically just after the publication?

Or maybe some other workaround solution exists?

New Project - 2024-05-07T161259.349.jpg
May 8, 2024 at 6:44 am #15604397

Prosenjit Barman
Supporter

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hi There,
Thank you for the update.

From the screenshot, it appears that your taxonomy terms are correctly translated and linked. To ensure that listings created in German also appear when filtering by the English taxonomy term, you should add both the English and German terms to each listing. This way, a listing created in German should also include the English term 'White'. This setup ensures that when you filter by 'White', the system recognizes and displays the corresponding German listings as well, since they include the English term.

Regarding making listings translatable and duplicating them automatically, unfortunately, WPML doesn't support automatic duplication of listings. However, if you want, you can enable automatic translation to automatically translate the listing. Check the guide below to understand the process.

- https://wpml.org/documentation/automatic-translation/

Another approach could be to set the translation preference for the 'Listing' post type to "Translatable - use translation if available or fallback to default language" in the WPML settings. This setting allows listings to be immediately available in other languages. You can later duplicate or translate the listing and make the translated version available in the secondary language.

But keep in mind that the filter might not display the results correctly until the associated taxonomy terms are linked properly to the listing in all languages.

I hope you can understand. Please feel free to let me know if you need further assistance or clarification in this matter. I will be happy to help.

Best regards,
Prosenjit

May 8, 2024 at 10:23 am #15605356

sergiyY

Hi Prosenjit,

Ok, thanks.
Another workaround solution came to my mind. Not to translate taxonomies, but translate needed texts with String translation (e.g. find all "White" values in the string translations list and translate it to "Weiß" for German language). I tested it, and this solution works, more or less. At least, I can use filters with any languages. However, the value was not translated anywhere across my website (in some places there's "Weiß" for German version, but somewhere there is "White"). What do you think about it? Can it work? Can missed translations be added somehow?

May 9, 2024 at 4:25 am #15608427

Prosenjit Barman
Supporter

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hello There,
Thank you for the update.

I'm glad to hear that you've made significant progress. It’s great that you've managed to implement a solution that allows you to use filters across different languages!

Just to let you know, taxonomy terms are also included in the String Translation section. So, if you translate a taxonomy there, you might run into the same issue again.

If you're unable to find the value you're looking for in the String Translation list, it may be necessary to search for it in the Admin Screens section of the string translation. Could you please follow the instructions provided in the link below and see if that resolves the issue?

- https://wpml.org/documentation/getting-started-guide/string-translation/finding-strings-that-dont-appear-on-the-string-translation-page/#translate-admin-and-settings-strings

However, if you're still unable to locate the text for translation, you might need to use WPML's hook to register that string for translation. For registering individual strings, the following hook could be helpful.

- https://wpml.org/wpml-hook/wpml_register_single_string/

I hope the information above will help. Feel free to let me know if you need further assistance or clarification. I will be happy to help.

Best regards,
Prosenjit

May 12, 2024 at 6:52 am #15617390

sergiyY

Thank you, I'll try it.