SOLVED: WPML template element use translated version

It seems that template conditions are not synced correctly between translations.


Also when translating a page that has another template embedded the translated version of that template is not used. Currently, our front page has both german and english translations. Translation works flawless, except for the template. That one keeps in german.

I provided login credentials already via your contact form, but i did not receive an answer or auto reply yet. Maybe i had a typo in there.

Hi @JUVO_Justin,

Can you please check your spam inbox as I sent you a reply yesterday, which may have been lost.

To reshare my answer here:

I have created an internal ticket to address the templates translations syncing issue. For now you could do it manually just as a temporary workaround.

Regarding the second point, I’m not enitrely sure how feasible it would be to make sure that templates added through the template element get dynamically assigned the correct language but I’ve also created a ticket to investigate this and see if we could provide a solution.

Let me know if you have any questions :slight_smile:

Hi @charaf thank you very much for getting back.

For the second option, i see two possible ways that should in theory be relatively easy to achieve.

  1. Inside the code part where you are parsing the widgets on a page, use wpml hooks to check if for the given template a translation exists, if so use the translation id instead of the original one. Of course, this is only an unsophisticated and rough explanation based on some explorations I had in bricks code.

  2. If you do not want to automatically replace the template without giving the user control, simply add templates to the translation control of wpml. I have done the same thing for some shortcodes in other projects. It should be possible to make the “id” of the template widget translatable. I think there even is a way to hide the field by default and make it only vsisible if you search for it in wpml´s translation editor. This way the user can actually control if the original template or the translated version should be rendered

Do you have a rough ETA? Will this be tackled with 1.9.2 release?

Hi @JUVO_Justin,

Yup I think it makes more sense if they get translated automatically if the template has a translation. Otherwise either use the default as a fallback or just don’t render it depending on WPML’s settings for the templates CPT. Though I can’t really provide a concrete ETA, but it won’t be in 1.9.2 as that was just released today.

I am really looking forwards to this “feature/fix” thing :smiley:

Sorry to bother you again, but we still have this bug which is blocking us from setting a project live. Do you have a rough estimate?

Hi @JUVO_Justin, sorry I can’t give any promises but it should realistically be included either in the next release or the one after it. As a workaround, you can set the correct template in the translated pages manually which I know is not ideal if you have a large number of these instances or if you’re doing frequent automatic translations.

Hi @JUVO_Justin,

The template’s auto-translation should be included in the next release (1.9.4) :slight_smile: once you translate a page with the translations editor, it will automatically use the translated version of the template element, and if it doesn’t exist, it will use the original as a fallback.

Regarding the template conditions syncing issue, are you still experiencing it? I’m unable to replicate it anymore so I wonder if it was a bug with an earlier version of WPML. Let me know if this is still an issue for you.

Hi Justin,

We’ve fixed this issue in Bricks 1.9.4, now available as a one-click update in your WordPress Dashboard.
Changelog: Bricks 1.9.4 Changelog – Bricks

Please let us know if you are still experiencing issues.

Best regards,
timmse

Hi,
This issue still persists for us . How was this resolved?
We’re using the latest Bricks 1.9.4.

We have the following setup
1.FRONT Page and inside it we use
2. Template elements with conditions for rendering specific language.

Using WPML and the translations are done, but when changing the language, it doesn’t render translated template.
BUT when I open up the template in preview mode and change language there, it works.

Ok I think I figured it out how to use it.
The issue were that

  1. We were waiting on the translations from Translation Service Crowdin for the Specific Page (not template).
  2. Couldn’t create translatable content for a specific Page language

Solution:
Step 1.

  • Delete (we did this) or complete the translation files in Translation Service (for us it’s Crowdin) for pages which are still in waiting/pending status in WP.
  • Sync new translations from “Translation Management”
  • Under WPML → Support → Troubleshooting “Clear the cache in WPML” & “Remove ghost entries from the translation tables”

These steps opened up the possibility to modify the pages for different languages again.
Step 2:

  • In WP Pages view, Click on the “Add translations to ‘XLang’” , where ‘XLang’ representing whatever language you need. This will open up WPML editor, complete it and the translations should now work when using templates inside of pages.
1 Like