Skip Navigation

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.

Our next available supporter will start replying to tickets in about 3.47 hours from now. Thank you for your understanding.

This topic contains 2 replies, has 2 voices.

Last updated by Phil Birnie 1 year, 11 months ago.

Author Posts
October 26, 2022 at 1:30 pm #12315713

Phil Birnie

What I am trying to accomplish:

Translate a template part on a site using full-site editing.

Our Setup:
1. Our particular site is using a multi-site.
2. We are using two languages: English and Spanish
3. The English site is hidden link
4. The Spanish site is espanol.getphoenixmedicare.com

The Problem:
Using full-site editing, it appears that template parts are not editable via the WPML interface. See "Screen Shot 2022-1026 at 9.12.57 AM.png"

How To Re-Create the Issue:
1. Create a theme that utilizes a template part using full-site editing
2. Use the Full-site editing interface to save a modification of the template part (this will save it to the database) - see Screenshot "full-site-editing.png."
3. There is no way to create a separate translation for another language

How I've gotten around the Issue:
I've noticed that WPML saves a separate post per language for pages, posts, navigation items, etc. (but not post types of wp_template_part that I can see)

1. Duplicate the "post" associated with the template part in the database and note the new post ID. (See database-duplication.png. In this case, we duplicated 13 to make 44 for the Spanish version of the site)
2. Insert a new row into the icl_translations table with the appropriate values (see translations-table.png)
3. Finally, add a row in the term_relationships table associating the new post (44) with the wp_theme taxonomy.

While this makes it "work," it requires one to go into the database and edit the entry directly -- not ideal and error-prone.

We would love to know a way to edit template parts on a per-language basis within the admin.

translations-table.png
database-duplication.png
full-site-editing.png
Screen Shot 2022-10-26 at 9.12.57 AM.png
October 26, 2022 at 5:08 pm #12317637

Marcel
Supporter

Languages: English (English ) German (Deutsch )

Timezone: Europe/Madrid (GMT+02:00)

Hi Artur,

before your ticket is assigned to one of my colleagues, please allow me to walk you through some initial debugging steps. This will help speed up the support process.

Did you check https://wpml.org/documentation/getting-started-guide/translating-content-created-using-gutenberg-editor/translating-sites-that-use-full-site-editing/#translating-full-site-editing-templates?

It works in two different ways:

1) Translating Unedited, Default Templates
-> via String Translation

2) Translating an Edited, Customized Template
-> via Translation Management

Best Regards
Marcel

October 26, 2022 at 6:22 pm #12317987

Phil Birnie

Hey Marcel,

Thanks - I think what was throwing me off is that the "Edit" button under Translation Management doesn't work for templates or template parts (goes to hidden link). However, the translation process outlined in the document you sent worked well.

Thanks for the guidance!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.