I am actually fighting with content templates translations using WPML for custom post types for which I need a different template for secondary language and noticed a few strange things I would like to be able to understand :
- When creating a new content template, I can choose between default and secondary language for it as for pages but there is no language switcher on the dedicated backend page which means the templates created in secondary language can not be edited anymore even though they seem to be existing (attached screenshot 1)
- If I edit a default language content template and change its language it disappear from the list for the same reason and thus become unreachable.
- When editing a default language content template there is a "Connect with translations" link (attached screenshot 2) which suggest there could be some (which is the case for me) but the link is not working, once again probably for the same reason, meaning I can't even reach them that way.
- If I add a translation to a default language content template using the "+" button (attached screenshot 3) I have no way to edit it once saved except for the string via WPML translation editor and neither can I delete it to add a new translation as I can not reach it .
- If I make some style changes on a Gutenberg block of the default language template, as for exemple adding a background and changing font size, the translated block gets messed up (attached screenshots 4 and 5) and the only way to get it fixed is to remove it and add it again as I can't edit the translation directly and have no grip on styles through translation editor.
- If I need to have different blocks on a template for the default language and the secondary language, which is my case for some of the CPT, I can't for the same reasons.
Content templates appear in WPML settings as "Translatable - use translation if available or fallback to default language" so I think the translated version should be reachable, editable and removable as it's the case for other content types which have the same settings but it's not the case actually and it's getting me in big troubles.
Could you please help me understand what's the correct way of doing to avoid those problems ?
In order for me to have a better understanding of what is happening here I will need to have a look at the site through the backend.
Would you mind allowing me to have admin access to the site as well as a link to a page where I can clearly see the issue with the content template translation.
Thank you for the clone as well as the detailed response.
I had a look at the issue you're having and it appears that what you're expecting is to essentially be able to create a new content template for your french posts.
The above documentation illustrates the correct way to translate the content templates as the methods have changed since the the recent updates in WPML with the new Advanced Translation Editor.
You'll also need the WPML Translation module setup for this to work.
Can you test the methods in the documentation and let me know if there are any improvements in your experience.
Thanks for the feedback and sorry to have missed some parts of WPML setup on the example website.
I finished the translation management setup but the problem also occurs from there :
- If I try to send to translation a content template which contains a view block, for exemple "Content template 7", the operation never complete (attached screenshot) meaning I can not translate it.
- If I go to "WPML > Translations" and try to edit existing translation of "Content template 3" on which I added a view block after it was translated, I get a critical error.
So could you please try to translate "Content template 7" on the exemple website to see if you encounter the same problem ?
And also please tell me if there is a way to have different blocks on default and secondary language content templates because it's also something I will need to find a solution for if I cannot edit secondary language content template individually as I can do with pages.
Well, I ran a few more tests but this time using the advanced translation editor which allowed me to discover that most of the problems I was previously encountering when trying to translate content templates including view blocks were in fact due to a WPML string shortcode I missed when removing them to see if the issue was related to their presence.
So the main issue is solved and I should now be able to deal with the blocks I need to show only in one language using conditional display with a custom function.
Thanks a lot for your patience and have a nice day.