Skip Navigation

[Resolved] Translating Legacy Views with WPML

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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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: Asia/Kolkata (GMT+05:30)

This topic contains 2 replies, has 1 voice.

Last updated by - 2 days, 6 hours ago.

Assisted by: Minesh.

Author
Posts
#2886441

Tell us what you are trying to do? We are translating the site using WPML.

Is there any documentation that you are following? https://toolset.com/course-lesson/translating-views-content-templates-archives-and-forms/
This documentation only refers to block-based Views. We have pages that contain Toolset shortcodes (often using parameters to generate the View - not possible in Blocks). The View CPT does not appear in the WPML translation management options, and our legacy views are broken.

Is there a similar example that we can see? (Hit Esc when you see the live site redirect page):
Compare hidden link and its german equivalent hidden link

You can see on the german page that the CPT and custom field content is being translated (e.g. Week > Woche), but the view is clearly completely broken. Please advise how we can ensure legacy views are rendered correctly.

#2886445

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Can you please check the following Doc:
- https://toolset.com/documentation/legacy-features/translating-legacy-workflows/

#2886454

Hi Minesh,
Thanks for that, but as you can see, the entire format has been broken by the translation. Having inspected the source code of each of the above pages, I think I can see the cause of the problem, and in fact I think we're just going to have to rebuild the content templates.
The code in the content template was very complex, so when we moved it to a Block CT, much of the old content template was simply added in as an HTML block containing lots of Toolset shortcodes. The normal rendering can just about cope, but add in the translation layer, and I think it's completely broken.
For example, in the legacy content template I wanted to be able to use the same CT but with different colours for Rentals/Resales, so (in about 2015) added the code:
<div class="anfi_advert anfi_ad_[types field=" timeshare-ad-type"]>
which generates classes anfi_advert anfi_ad_Rental and anfi_advert anfi_ad_Resale, depending on the type in question.
On the german page this has rendered as:
<div class="anfi_advert anfi_ad_[types field=" timeshare-ad-type="" field="timeshare-ad-type" if="( $(wpcf-timeshare-ad-type) eq '925' )" from="" original="PC9oMz4="></div>
Clearly broken.
Time to rebuild the content template properly, I think.