WPML with Header and Footer Parts

It seems there are some weird issues happening with blocks inside the header and footer parts that I set as global fragments and translated into a second language.

In the footer part for example: In the backend everything is fine in both languages. But on the frontend in one language there are always the styles for some blocks (like the section block for example) missing. If I save the footer part for this language again, the styles for the section block in the other language are missing on the frontend.

The same issue occurs in the header part with the taxonomy list block for example.

Last week these issues doesn’t happen. I’ve set up the footer and header in both languages and everything worked fine. But now that I’ve tried to change little things, these issues started to occur. I’ve already regenerated everything and build the elements inside the footer part at least from stratch again because I thought maybe these issues occur because I copied the footer elements from the original language into the translated template part.

Kind regards
Marco

Meanwhile the problem also affects the single post template and a non footer/header fragment.

On the fragments dashboard, the custom fragment can only be applied for one language. As soon as I want to apply it for the other language, the template part in the first language gets deleted from the fragment.

Single Post Related Articles Query, worked fine before, but in the last days more and more problems with WPML start to occur.


On the german post, everything is fine


English Version, styles get lost.

The styles for the new container block don’t get applied as well as the styles in the custom category dropdown


Footer, simple section styles don’t get applied


And last, the colors of some backend texts in dark mode get overwritten by WPML CSS.


Size, weight and line height are set but barely visible for example.

Hello @MarcovB,

Thanks for the report here and my apologies for the trouble.

While we’re investigating/fixing all reported issues with WPML, could you possibly let me know if you are simply translating the strings for your different template parts or more specifically duplicating the template parts in some way?

Thanks in advance.

Cheers,

Hey,

I’m duplicating the templates, parts etc. The string translation wpml plugin isn’t installed. It was installed in the beginning, but I didn’t need it, since only 4 or 5 irrelevant strings were found.

In most cases I created a new template/part in the second language, copied the blocks over from the first language and then made the translations. For test purposes I recreated the footer part in the second language from scratch but the styles were still missing.

Since this behavior has started, more and more parts of the website are affected when I’m trying to update/change them.

Hello @MarcovB,

Thank you for your response.

I’m not quite sure I follow the exact method you’re following.
How are you duplicating the templates, parts → applying them to posts etc?

While we have a fix for styles missing on translated templates/posts, you don’t seem to be following the recommended string translation proposed by WPML: https://wpml.org/documentation/getting-started-guide/translating-content-created-using-gutenberg-editor/translating-sites-that-use-full-site-editing/

Are you sure about this? Even with the current implementation, WPML should find all Cwicly blocks strings.

Thanks in advance.

Ah, maybe I’m using the wrong approach. I come from a non-fse theme (Kadence) and there you could duplicate the pages, posts etc. including the content and then simply translate the duplicated version. I tried to use the same method here.

I will try the method described in the article and let you know later if there are still problems.

I will also test the string translation plugin again.

Hey @MarcovB,

Thanks for your response.
We’re in contact with WPML currently, so I will also clear all of this with them.

1.2.9.9 brings a few fixes to WPML compatibility, and I’d be grateful if you could check this out on your end and see if it sorts the issues you have been experiencing.

Cheers,

I installed the newest version and tested it a bit.

Now a new problem appeared. :sweat_smile: The cwicly paragraph and heading block in the second language can’t be styled at all. In the first language it works as usual.

Before the update I got the footer and header part to work. I used the translation management menu in WPML to duplicate the template parts (this menu was hidden at first, I had to do some troubleshooting inside WPML settings to make it visible) and then translated the duplicated template part itself. Now after the update, the template parts randomly changed back to the original language without me working on them at all and I have to translate them again.

The taxonomy names inside a filter block are still only displayed in the main language and don’t get translated. Everywhere else the taxonomies are translated properly.

The styles in dark mode now apply correctly.

I hope that helps. Let me know if you have questions. I can send a few screenshots then.

Kind regards,
Marco

Hello @MarcovB,

Thanks for checking this out.

I’m not sure I quite understand the part about duplicating template parts… As I’m not able to duplicate them myself → I’m not sure this is even supported by WPML.

As stated previously, WPML clearly states you should translate the strings: Translating Sites that Use the WordPress Site Editor - WPML

Can you please describe step by step how you’re achieving translation for template parts currently?

Thanks in advance.

It’s a feature of WPML. You can duplicate them directly in Translation Management Menu.

  1. I have a template part, the header for example, in the main language English with my menu etc. The template part in the second language German is without content.

  2. I go to WPML > translation management and select the template part I want to duplicate. Under select translation options, you can choose duplicate content. This copies the blocks from the English header template part to the empty German header template part.

  3. In WPML > translations, some templates can be edited there. The header and footer template parts can’t.

I tested the editing feature there with the single post template but it’s a mess. The ![start]! and ![end]! etc. get copied to the frontend and shift the whole layout.

  1. After I’ve duplicated the header template part, I switch the language to German and go the header template part in the cwicly themer. Because the copied content is of course in English, I translate the blocks inside the site editor. This approach generally works. For some time everything is fine on the frontend. Then something happens and it gets messed up in some way.

I tried the string translation method as well. From a usability standpoint translating the templates right in the side editor is much easier and faster than searching for every string and then translating it.
I translated the strings from the mega menu with this method. As soon as I were done with it, all the translated parts changed back to the original language. So there appears to be the same problem of not knowing how long the translation really lasts. :sweat_smile:

Yes it is but for normal post types and, unless I’m mistaken, not the way you should be translating your Templates/Parts. I’ll reference this link one last time: https://wpml.org/documentation/getting-started-guide/translating-content-created-using-gutenberg-editor/translating-sites-that-use-full-site-editing/

Or at least, WPML has not sorted this out on their end as the behaviour you describe is present on a clean installation without Cwicly installed and the default theme. So I would definitely recommend reaching out to them, since this is out of our control.

Once again, it is my understanding that this is not a supported behaviour by WPML. I urge you to take it up with them.

This is unusual as I have not been able to reproduce any issue concerning string translations and their reverting to the original strings. Was this after you duplicated the template/parts or on a separate installation?

Sorry for the late reply.

I have reset WPML and deleted the duplicated templates to start fresh. I translated all the templates/template parts via translation management/string translation exactly liked described in the article. After some fiddling almost everything works as expected. Only 3 problems remain:

  1. The nav dropdown item doesn’t get translated although I translated it via string translation. All other menu items get translated.
  2. All texts in the filter blocks (filter type “button single”, “button multiple” and “select” in my case) can’t be translated. No strings are found for the select filter (“sort” etc.) and the button filter should translate the taxonomy terms automatically I think.
  3. In posts and pages in the second language the texts can’t be styled at all. The styles apply at the backend but not at the frontend.

In English


Same text on the German site on the frontend. In the backend it’s styled red, bigger and bold.

Maybe something is stilled messed up with the site, I don’t know. Let me know if it’s only me or it’s a general thing.

And thanks for your patience, Louis. :smile: