Skip Navigation

[Closed] Modal not working in Toolset View Translation via 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
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Sao_Paulo (GMT-03:00)

This topic contains 21 replies, has 5 voices.

Last updated by alexanderW-6 1 year, 9 months ago.

Assisted by: Mateus Getulio.

Author
Posts
#2600083

Hey Mateus,

yes, you can do that.
But please delete it afterwards due to privacy issues.
Thanks for your help.

Joshua

#2600343

Mateus Getulio
Supporter

Languages: English (English )

Timezone: America/Sao_Paulo (GMT-03:00)

Hi Josh,

Thanks for your confirmation.

May I kindly ask you to tell us how exactly did you build the element on the page that triggers the popup? Sorry about this back and forth, but we couldn't find this information.

We're looking forward to your reply. Thank you!

#2602733

Hi Mateus,

sorry for the late response. I explain it for the german site version (which is working as expected).
I have a content template "tabs-mietpark" and in this content template I have 2 views:
"tabs-mietpark-1" and "tabs-mietpark-2".
"tabs-mietpark-1" contains the trigger for the tablist.
"tabs-mietpark-2" contains the tabpanel as well as the view "accordion mietpark in tabs".
"accordion mietpark in tabs" contains the accordion and the modal trigger and modal information.
Tabs, accordion and modal based on bootstrap.

I hope that helps! Thank you very much!
Josh

#2602999

Mateus Getulio
Supporter

Languages: English (English )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello again,

I have double-checked the problem, but so far I haven't been able to find a fix. I asked my colleagues to take a look to see if there's anything I'm missing.

I'll come back here as soon as one of them answers me (which shouldn't take long). Thank you in advance for your patience!

Regards,
Mateus.

#2603483

Mateus Getulio
Supporter

Languages: English (English )

Timezone: America/Sao_Paulo (GMT-03:00)

Hi Josh,

Thanks for your patience.

I have escalated this ticket to our 2nd tier of support where our 2nd tier specialists will take a deeper look at this issue and will try to find a solution.

I will get back to you as soon as I get an answer from them.

Best regards,
Mateus

#2604081

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hello Josh

My name is Nigel and I'm the second tier supporter in Toolset. Let me interact with you directly rather than via Mateus, as this thread has already passed through several hands is already somewhat confused. (This is understandable, because how Views and templates are translated changed with the introduction of Blocks and the View block, and the documentation linked to earlier assumes you are using the Blocks editor, but you are using the legacy editor for Views and templates.)

I have been looking at your site but I haven't been able to get very far analysing the problem.

On your site the default language is English, and you have German as a secondary language.

But when you describe the templates and Views which you set up to work with these modals, you talk about the German versions.

However, in the back end when you go to Toolset > Content Templates or Toolset > Views, it only lists the English templates and Views. The German versions cannot be accessed.

That is partly by design (but also reflects a design flaw).

Typically, it was not required, nor expected that you translate Views or templates themselves.

Clearly the texts output by a View or template would need translating, but the View or template itself would not be translated.

If you added a View (via shortcode) to a page and translated the page (retaining the same shortcode), on the front end when you switched to the second language the WPML would modify the View query so that it returned results in the intended language. In the output of the View, where you had dynamic content—e.g. you output the post title using the wpv-post-title shortcode, or custom fields using shortcodes—this would automatically retrieve the correct language version of the text to be displayed.

Static texts—e.g. if you included an H3 heading with some static text—could be handled by wrapping the texts within wpml-string shortcodes, and then locating and translating those texts with WPML String Translation.

So all of the texts output by the View or template would be generated in the appropriate language, even though the same View or template was being used with each language, without translating the View or template directly.

It was, nevertheless possible to translate Content Templates, for the scenario where you wanted the design of the page (and not just the page texts) to be different in different languages.

The design flaw I referred to earlier is that you can only translate Content Templates with the WPML translation editor, it is not possible to edit a different language version of the template in the WordPress editor (whether you use the Classic editor or the Block editor), as there is no language switcher in the admin toolbar to switch to another language when listing the available templates, nor is the WPML UI available to set language and choose editor available when editing templates in the default language. (I see we have some internal developer tickets about this issue which have gone stale; I am going to push for them to be handled soon.)

In your scenario, whereby you have a template that includes Views which between them are responsible for outputting a modal, I would expect these to have been created in the default language and to not have been translated themselves, but for texts generated by the Views and templates to be translated as I described above.

And in that case I would expect the functionality around modals to work in whatever language the page was being visited in.

But right now we have a scenario where you have some English Views and some German Views and some English templates and some German templates, though because the default language is English and because there is no language switcher available when listing Views or templates, it is not possible to open the German Views or templates in the editor. It is—I understand—the German versions which are working, and the English which are not, which is unfortunate, given that English is the default site language.

I wonder if you have been able to edit in both languages by switching the default language while editing?

In terms of how to resolve this, it implies work, but my instinct is to decide categorically which is the default language for the site and stick with that, recreate the Views and templates in that language as necessary, then delete any Views or templates which are in the other language. (I would likely need to help you with that.) Set both Views and templates as not translatable. Then translate any outstanding texts via string translation, as described above.

Let me know your thoughts.

#2604819

Hi Nigel,

your instinct is right. I created the whole site in german and then switch to english as the default language due to SEO reasons.
I think this one reason for the chaos in the views, templates and it's translations and everything. I finally translated the views and templates because of the earlier advise in this thread to do so. I did not know, that it just a workaround for the block editor.
Nevertheless, I will try what you recommended and build the whole template-view-construction again in the default language (english) and see if this finally works. I'll get back to you, when I'm done with that and let you know.

Thanks!

The topic ‘[Closed] Modal not working in Toolset View Translation via WPML’ is closed to new replies.