WPML (WordPress Multilingual Plugin) is a powerful tool that allows you to create and manage multilingual websites.
With WPML, you can easily translate your website’s content, including posts, pages, custom types, taxonomies, menus, and even the theme’s texts. It supports over 40 languages and provides an intuitive interface for translating content, making it accessible to a global audience.
Use Case: Creating a bilingual website (English and Spanish)
Imagine you want to build an eCommerce website that caters to both English and Spanish-speaking customers. WPML can help you achieve this by translating your website’s content and ensuring a seamless experience for users in both languages.
To begin with, let’s focus on translating basic strings in Shoptimizer and CommerceKit. These include text elements such as buttons, labels, and headings.
1. Install and Activate WPML
![WPML plugins](https://www.commercegurus.com/wp-content/uploads/2024/06/wpml_plugins.png)
Ensure that the WPML Multilingual CMS and its associated plugins (String Translation, Translation Management, and WooCommerce Multilingual & Multicurrency) are installed and activated.
Note: It is very important that all of these WPML plugins are installed and active!
2. Setup WPML
Configure the plugin by selecting your default language (English) and the secondary language (Spanish). Follow the setup wizard to complete the initial configuration.
![WPML Setup](https://www.commercegurus.com/wp-content/uploads/2024/06/wpml-setup-en_es.png)
3. Translating Strings
Watch our video guide to Shoptimizer string translations to see the exact steps used.
We also have a video guide to CommerceKit string translations:
To start with we need to translate some text strings. Let’s start with “Add to wishlist” which is text from CommerceKit’s wishlist module.
!["Add to wishlist" in English](https://www.commercegurus.com/wp-content/uploads/2024/06/wpml_add_to_wishlist_before.png)
The above screenshot shows what it looks like before we begin. You can see that we are on the Spanish version of the site (denoted by the /es in the URL), but the text is still displayed in English.
Next, we’re going to translate it.
![String translation in WPML](https://www.commercegurus.com/wp-content/uploads/2024/06/wpml_add_to_wishlist.png)
- Navigate to
WPML > String Translation
- Search for the string you want to translate (e.g., “Browse wishlist”).
- Click on the translation icon next to the string and enter the translated text in Spanish (e.g., “Explorar la lista de deseos”).
- Save the translation.
!["Add to wishlist" has now been translated](https://www.commercegurus.com/wp-content/uploads/2024/06/wpml_add_to_wishlist_after.png)
The string translation was successful and now we see it correctly displayed in Spanish.
4. Translating strings not found in WPML
Next, we’d like to translate the “Shipping and Checkout” string in Shoptimizer. However this string was not immediately visible within WPML.
![The string was not found within WPML](https://www.commercegurus.com/wp-content/uploads/2024/06/wpml_shipping_checkout_not_found.png)
Go to WPML > Theme and plugins localization
and select the theme and plugins related to your product and click on the Scan selected themes/plugins for strings button.
![Scan selected themes option](https://www.commercegurus.com/wp-content/uploads/2024/06/wpml_scan_themes.png)
Now you should be able to see the strings for Shoptimizer and CommerceKit and start the translation, by clicking on the Translate button.
![Translating "Shipping and Checkout"](https://www.commercegurus.com/wp-content/uploads/2024/06/wpml_shipping_checkout.png)
Now, we can go to WPML > Translations
and select what we want to translate, i.e. the ‘Shipping and Checkout’ string.
![Now we can translate "Shipping and Checkout"](https://www.commercegurus.com/wp-content/uploads/2024/06/wpml_shipping_checkout_translate.png)
We do this by entering the correct phrase within the Translation (Spanish) field.
!["Shipping and checkout" in Spanish](https://www.commercegurus.com/wp-content/uploads/2024/06/wpml_shipping_checkout_es.png)
Now, we can see the string translated into Spanish on the frontend.
!["Shipping and checkout" after translation](https://www.commercegurus.com/wp-content/uploads/2024/06/wpml_shipping_checkout_after.png)
5. Translating CommerceKit’s Attribute Swatches
See our video guide to follow along with the exact steps required:
When dealing with variable products, you may encounter issues with translating attribute swatches. These swatches are essential for displaying product variations such as colors and sizes. Currently, CommerceKit Attribute Swatches and Attribute Galleries do not support the direct translation method.
Instead, we use the duplicate method to ensure that attribute swatches and galleries are displayed correctly in the translated product.
Problem: The translated product does not show the attribute swatches, but the original language version does.
This is the original product page in English with image swatches correctly displayed:
![Original English version has swatches](https://www.commercegurus.com/wp-content/uploads/2024/06/wpml_product_en_with_swatches.jpg)
However if we use the translate method in WPML, we can see that the swatches do not carry over to the Spanish version.
![Spanish versions without image swatches](https://www.commercegurus.com/wp-content/uploads/2024/06/wpml_product_es_without_swatches.jpg)
Here is how to solve it.
Go to WPML > Settings
and ensure that the Product and Variations (product_variation) post types are set to translatable.
![Ensure that Products and Variations are translatable](https://www.commercegurus.com/wp-content/uploads/2024/06/products_variations_translatable.png)
Next, delete the incorrectly translated product. Navigate to the translated language (Spanish) > Products.
Find the incorrectly translated product, move it to the trash, and delete it permanently.
Duplicate the Original Product
Go to the original language (English) product edit page. Look for the Duplicate option instead and duplicate the product.
![Duplicate the product](https://www.commercegurus.com/wp-content/uploads/2024/06/wpml_duplicate_button.jpg)
Now, you’ll be able to edit the Spanish version. Click the pencil icon to do so.
![Edit the duplicate](https://www.commercegurus.com/wp-content/uploads/2024/06/wpml_duplicate_edit.jpg)
Click on the text you wish to translate, enter the correct phrase, and then click the check icon. When you are finished translating each string, click the Complete Translation button at the bottom of the screen.
![Completing the translation in WPML](https://www.commercegurus.com/wp-content/uploads/2024/06/wpml_duplicate_translate_en_es.png)
Now, we can see the finished result. The Spanish version has swatches, just like the original English.
![Finished result](https://www.commercegurus.com/wp-content/uploads/2024/06/wpml_product_es_result.jpg)
By following these steps, you can successfully use WPML to translate your Shoptimizer store’s strings as well as more complex elements such as attribute swatches and provide a multilingual experience for your customers.