Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
If you're trying to translate a template and using block theme, but the translated template is not showing and being applied on the translated page check next solution.
Solution:
We have identified this as a known issue and are working on a permanent fix. Meanwhile, here's a workaround that should help:
Follow these steps:
- Remove the translated template.
- Enable Slug Translation in WPML > Settings (Page URL > Translate).
- Navigate to

wp-content/plugins/sitepress-multilingual-cms/classes/full-site-editing/BlockTemplates.php

and comment out the line:

$postData['post_name'] = $post->post_name;

- Send the template to the translation.
- Translate the template, ensuring that the slug is correct, for example, 'page-homepage'.

If this solution doesn't seem relevant to your issue, please open a new support ticket with us.

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Tagged: 

This topic contains 14 replies, has 2 voices.

Last updated by Dražen Duvnjak 10 months ago.

Assisted by: Dražen Duvnjak.

Author Posts
January 12, 2024 at 11:07 am

Martynas.V

Homepage doesn't look same

January 12, 2024 at 12:09 pm
January 15, 2024 at 8:40 am #15183571

Dražen Duvnjak
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+01:00)

Hello,

thanks for the patience, I have checked but couldn't find a solution.

I created a minimal installation of WordPress, WPML, and all necessary WPML add-ons.

You can access the WordPress dashboard using the link below:
- hidden link

Kindly follow the steps below:
- Set up WPML as in your website
- Try to replicate the issue with image banner in simple example
- Share with me step by step guide on how can I check the issue

This will help us to report the probable issue to the compatibility team and solve the possible problem faster.

Thanks,
Drazen

January 15, 2024 at 8:59 am #15183725

Martynas.V

Hello,

you can do all the testing at: hidden link It is as simple as it can be with minimal plugins.

I created template for homepage and wanted to translate it and have the same layout in other languages. As I see it - problem is that the layout is saved for specific "titulinis" page and it is not copied when translating. Maybe I am wrong.

January 15, 2024 at 9:19 am #15183780

Dražen Duvnjak
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+01:00)

Hello,

thanks for getting back, it is not up to testing, but confirming if this is a specific issue or a general bug that can be reproduced.

I thought it would be easier for you to try to reproduce as you are familiar with the theme and templates. I will try now to reproduce it my self.

Also I can not check further your site as there is banner site was moved, please follow the banner steps in both domains.

Let me know when you do, so I can further check.

Screenshot_1.jpg
January 15, 2024 at 9:39 am #15183851

Martynas.V

It was the first time I used default theme so I don't have any experience here.

Banner is fixed I think.

January 15, 2024 at 12:02 pm #15184867

Dražen Duvnjak
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+01:00)

Hello,

I checked further and it seems it is a known issue and we are working on a permanent fix for future versions.

In the meantime, I have applied the next workaround and it works fine for you.

Workaround

Make sure that the template slug in both languages matches the slug of the pages in question

OR

- Remove the translated template
- Enable Slug Translation in WPML > Settings (Page URL > Translate (this will include the slug in the translation and not create it automatically from the title))
- Go to: wp-content/plugins/sitepress-multilingual-cms/classes/full-site-editing/BlockTemplates.php and there comment-out the line:

$postData['post_name']  = $post->post_name;

- Send the template to the translation
- Translate the template while making sure that the slug is the correct one, for example page-homepage

Regards,
Drazen

January 16, 2024 at 1:07 pm #15189867

Martynas.V

Hello Dražen,

I see that the second options need plugin editing so thats a no no for me.

As for a first option where can I find "template slug" ? And which option did you use?

P.S. thank you for figuring this out.

January 16, 2024 at 1:16 pm #15189891

Dražen Duvnjak
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+01:00)

Hello,

I already applied the 2nd option for you, as it is an easier method. The first one would probably require some changes to the database, as I do not see the option to change the template slug inside WordPress manually.

Let me know if you have any further doubts about the method.

Regards,
Drazen

January 16, 2024 at 1:30 pm #15190052
Martynas.V

Few problems:
1) how to "Remove the translated template"? Or you meant page?
2) I re-did translating homepage but somehow it redirects me to original language homepage. I had this problem before but don't remember how I fixed it?

New threads created by Dražen Duvnjak and linked to this one are listed below:

https://wpml.org/forums/topic/split-redirects-me-to-original-language-homepage/

January 16, 2024 at 1:55 pm #15190373

Dražen Duvnjak
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+01:00)

Hello,

1) No, I mean translated template. From the top admin bar change language and then go to Appearance > Editor > Template > Show All template > three dots and delete template.

2) I am not sure exactly what you mean. We limit 1 issue per 1 ticket, to keep things clear and easy to follow. I have opened a new ticket for your new issue and lets discuss it there:

- https://wpml.org/forums/topic/split-redirects-me-to-original-language-homepage/

Regards,
Drazen

January 17, 2024 at 7:40 am #15192884

Martynas.V

Hello,

I don't see the translated template. I think this is original language template. Or should I delete this one?

Capture.JPG
January 17, 2024 at 8:54 am #15193525

Dražen Duvnjak
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+01:00)

Hello,

because you are probably checking in the original language, you need to change the language from the admin top bar and then check the editor.

I have already applied and translated the template for you on the mentioned website, you can continue to use and translate it manually.

If you need help with same on some other website, let me know and I can help.

Regards,
Drazen

January 18, 2024 at 7:37 am #15198233

Martynas.V

Hello,

yes, this is a production website: hidden link I want to replicate your fix but just can't see english templates.

Screenshot from my last reply is from this website.

January 18, 2024 at 7:45 am #15198263

Dražen Duvnjak
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+01:00)

Hello,

okay, no worries, I can do it for you and apply the fix.

Please share admin access and FTP and make sure to have a backup.

Regards,
Drazen