Site Editor with Polylang Pro

  1. Default language of a template part
  2. Displaying the language metabox
  3. Translating a template part
  4. How to delete a template part
    1. Deleting a template part in the default language
    2. Deleting a template part in a secondary language

With Polylang Pro template parts become translatable.

/!\ Do note that the templates themselves cannot be translated.
In edition mode of a template the language metabox is replaced by the below message:

templates cannot be translated
Message displayed in the edition mode of a template

1. Default language of a template part

When a template part is created, it will automatically be assigned the default language selected in the Languages list table. In the screenshot below, the default language is set to French and thus the template part is assigned the French language.

languages list table
Language list table in the Languages menu
Default language of the languages list assigned to the template part upon creation

If no translation is found for a template part, and none is created, it will be used for all other languages. In this instance, a message is displayed to let the user know that the template part which is being edited only exists in one language and will be used on all other languages.

2. Displaying the language metabox

To access the Polylang metabox, click the languages button to expand the embedded view and display the languages metabox, this metabox allows to translate the template parts.

Language metabox in TP
Displaying the languages metabox in a template part

3. Translating a template part

The Language displayed under the label “Language” is the current language of the template part.

To create a translation for a template part, click on the “+” sign available next to the language you wish to translate the template part in.
Once a template part has been translated a little star next to the language indicates the default language.

4. How to delete a template part

1. Deleting a template part in the default language

It is important to note that if the template part in the default language is deleted, all other languages of the TP will also be deleted.
A message is displayed upon clicking on the bin of the default language to inform the user of this synchronized action.

Click on the GIF to expend it

2. Deleting a template part in a secondary language

Click on GIF to expend it in a new window

Whereas when deleting a template part of any secondary language will only result in the removal of this specific template part. A confirmation pop-up still displays.