- Default language of a template part
- Displaying the language metabox
- Translating a template part
- How to delete a template part
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:
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.
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.
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.
2. Deleting a template part in a secondary language
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.