Skip Navigation

[Resolved] Using WPML shortcodes as dropdown placeholders break search filters

This support ticket is created 3 years, 2 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 - - 9:00 – 13:00
14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 - - 14:00 – 18:00

Supporter timezone: Africa/Casablanca (GMT+01:00)

This topic contains 17 replies, has 3 voices.

Last updated by caroleM-4 3 years, 1 month ago.

Assisted by: Jamal.

Author
Posts
#2186837

I forgot to mention that you can check my test site using this one-click-login URL hidden link

#2188989

Thanks for the feedback Jamal and sorry for the late reply. I had to deal with a few emergencies and could not come back to this project until now.

As for the contente template translation, I mentioned the ticket here just to give you the full picture of the problems I am encountering so I agree with you to leave it out of this discussion even though the hints you gave me helped me understand a few things.

Concerning the string translation solution you propose to replace WPML shortcodes I did try it before with no success but I guess it's because I did not think about activating the "Look for strings while pages are rendered" as strings were already existing in WPML and neither did I think to delete them.

I tried again and managed to translate placeholders and labels this way but unfortunately also noticed that the text of the Gutenberg blocks included in the view could not be translated this way.

This means I could actually use this method combined with WPML shortcodes for Gutenberg blocks but that wouldn't be ideal if those shortcodes are meant to be dropped in the future.

Anyway, I guess I'll have to find a solution to get the whole thing working without using content template translation at least for content templates containing views as these are really unstable in this context.

I'll try to see if I can solve this part of the problem via custom shortcodes but, if you have another magical idea, I would be interested of course.

Have a nice day.

#2189795

Well, I ran deeper tests and found out that using the "Look for strings while pages are rendered" option in the context of view blocks leads to the registration of new strings with a different domain which prevent normal translations to be applied.

Even if there was a workaround to avoid this, the multiplication of similar strings with different domains and the need to enable the "Look for strings while pages are rendered" after each consequent changes made to the concerned view blocks would make it very uncomfortable to manage even for us.

As I do not want of a solution that may become painful in the long term and did not find any stable alternative, I resigned and went back to normal translations but this time using the advanced translation editor which allowed me to discover that most of the problems I was previously encountering when trying to translate content templates including view blocks were in fact due to a WPML string shortcode I missed when removing them to see if the issue was related to their presence.

Sorry for this mistake and the time lost, I would probably not have gone so far on this path if understanding from the start that both problems had the same origin, this even if it will really not be easy for our customer to switch to the translation editor.

Maybe you should mention somewhere on Toolset documentation that WPML string shortcodes should not be used in view blocks, this in order to avoid other users doing the same mistake as these shortcodes are still appearing on WPML documentation (https://wpml.org/documentation/support/wpml-coding-api/shortcodes/) and absolutely not mentioned as deprecated.

Thanks a lot for your patience and have a nice day.