How to Translate WooCommerce Product Tabs with Polylang

Translating your WooCommerce products is crucial for reaching a wider audience. Polylang is a popular plugin that makes this process relatively straightforward. This article focuses specifically on translating your custom product tabs using Polylang.

1. Polylang Settings Configuration:

First, navigate to the Polylang settings in your WordPress dashboard. You’ll need to enable translation for specific elements. Go to the “Settings” tab and then to “Custom post types and Taxonomies”. Here, ensure that the following are enabled for translation:

  • Global product tabs
  • Product categories
  • Product tags

2. Product and Tab Creation (English):

Let’s start by creating the English version of your product and its associated tab.

  • Product: Create a new product in English. Give it a title (e.g., “English Product”) and a description.
  • Category: Create a new product category in English (e.g., “English Category”) and assign it to your English product.
  • Tab: Create your English product tab (e.g., “English Tab”). Crucially, assign the “English Category” to this tab. This links the tab to the product via the category.

3. Product and Tab Creation (German):

Now, create the German versions of your product and tab.

  • Product: Create a new product in German (e.g., “Deutsches Produkt”) with a German description.
  • Category: Create a new product category in German (e.g., “Deutsche Kategorie”) and assign it to your German product.
  • Product Connection: Very Important: Connect this German product to its English version using the Polylang language switcher. This establishes the link between the translated products.
  • Tab: Create your German product tab (e.g., “Deutsche Registerkarte”). Assign the “Deutsche Kategorie” to this tab.
  • Tab Connection: Also Important: Connect this German tab to its English version using the Polylang language switcher, just like you did with the products.

4. Product and Tab Creation (French):

Repeat the same process for the French version.

  • Product: Create a French product (e.g., “Produit français”) with a French description.
  • Category: Create a French product category (e.g., “Catégorie française”) and assign it to the French product.
  • Product Connection: Connect the French product to both its English and German versions.
  • Tab: Create a French product tab (e.g., “Onglet français”). Assign the “Catégorie française” to this tab.
  • Tab Connection: Connect the French tab to both its English and German versions.

5. Testing:

Visit the product page on your website. Use the Polylang language switcher to change the language. You should see the corresponding translated tabs displayed for each language.

By following these steps, you can effectively translate your WooCommerce product tabs using Polylang, ensuring a consistent and localized experience for your customers. Remember to connect the translated products and tabs correctly for the system to work as expected.