In this tutorial we’ll show you how to set up a multi-language site using our theme and WPML (The WordPress Multilingual Plugin).
WPML is the most popular choice for setting up multi-language / multi-currency WordPress sites, so we’ve built The Retailer having that in mind.
It’s a premium plugin. The cost is $79. You can purchase it here: http://wpml.org/purchase/ The ‘Multilingual CMS’ version is what you need.
It got to be the most popular choice cause it’s complete, you can translate pages, posts, custom types, taxonomy, menus and even the theme’s texts, it’s reliable and they provide great support, helping you deliver perfect multi-language websites on time.
WPML consists of several modules. The basic module turns WordPress sites multilingual. Other modules help with an enhanced translation process, string translation, media translation and other functions such as setting up a multi-currency ecommerce site.
You can learn about the different modules in the WPML Core and Addons page.
First time you install WPML, follow these steps:
- Log in to your WPML.org account and go to the Downloads section to grab the plugin. Download WPML Multilingual
- Now we’ll head on to the WordPress administration panel to install the WPML plugin. Navigate to the Pluginssection and click “Add New”.
- Upload the file you’ve just downloaded from WPML.org and click “Install Now”.
- After the installation completes, activate the plugin.
After you activate WPML, go to the Plugins admin page. You will see a message asking you to register WPML.
Registering WPML means connecting your site to WPML. This will help you install the required addons via the WordPress admin panel and will also set up direct updates whenever they’re available.
Follow the link to “Purchase a subscription or enter an existing site key” and you will see WPML’s info box:
Click where it says ‘WPML account’. This will take you to your account and auto-register your site. You will need to confirm that you’re adding this site. Then, you will see the key to activate WPML on the site. Copy your site-key. You can select it by double clicking on the text and copying to the clipboard (CTRL-C).
Now, return to your WordPress site and enter this site key. Click OK to complete the registration.
Your site should be registered now. From now, you will receive updates to WPML and its components automatically to the site that you just registered.
You will see a list of WPML components which are available for you to install.
now the addons required, are:
- WPML Translation Management
- WPML String Translation
- WPML Media
Select the checkboxes next to the components that you need. If you also want to activate the plugins immediately, also select the checkbox ‘Activate after download’. Then, click on the ‘Download’ button. If you don’t choose the option to activate, these components will be downloaded and installed onto your WordPress site and you can activate them later from the Plugins page.
We’ll now install a 2nd plugin, which are part of the Multilingual CMS package. This ‘glue’ plugin makes it possible to run fully multilingual e-commerce sites using WooCommerce and WPML. It makes products and store pages translatable, lets visitors switch languages and order products in their language.
- Navigate to the Plugins section and click “Add New”.
- You won’t have to upload it this time, you can install it from the repository by searching for “WooCommerce Multilingual”.
- Activate “WooCommerce Multilingual”.
Navigate to the WPML section in your WordPress admin panel to finish the setup. Choose the languages your translating your content to, add a language switcher and you should be ready to start translating your content.
When you click on the ‘+’ icons in the posts or pages list, a new page opens in the new language. You can enter the translation, just like you create the original content.
For example, if I go to the list of pages and click on the ‘+’ icon, under German, for the ‘Hello world’ blog post, I create a new German translation for ‘Hello world’.
Click on the image to see it in full size. You’ll notice that the language of this post is German and that it’s the translation of the Hello world post in English.
Most stores are arranged by product categories. Some also use tags. If you are using variations, you are probably using product attributes as well. WooCommerce Multilingual makes it easy to translate all these. First, create the product categories, tags and attributes in the default language, using the standard WooCommerce editing interface. Don’t worry about translating them just yet. Hint: product categories, tags and attributes are all stored as WordPress taxonomy. WooCommerce Multilingual includes a convenient interface for translating taxonomy terms. Go to WPML → WooCommerce Multilingual. This time, look at the other tabs on the screen. You will see a tab for each of the taxonomy that belongs to your store.
Each of these tabs includes a different taxonomy. Click on it to see all taxonomy terms and translate them. To translate a term, click on its label. You will need to enter the name, slug and description. The name is what’s displayed on the screen. The slug appears in the URL and the description shows on the WordPress admin, when editing. If your store includes many categories, or other taxonomy term, use the search function to locate them quickly.
Now that your product taxonomy is translated, it’s time to translate the products themselves. First, create the products in WooCommerce in the default language. Don’t worry about translating them just yet. Create products normally, as you do with WooCommerce. You can create standard products, variable products, downloadable products and anything else that WooCommerce has to offer. Once your products exist, go to WPML → WooCommerce Multilingual. This time, click on the Products tab.
The products table gives you a summary of all products in your site. If you have many products, you will see the in pages and can use the filter and search to reach the exact products you are looking for. The translation status icons help you find products that are untranslated or need update. Click on the Edit translation links to translate products. You will find a row for each of the translation languages in your site.
WooCommerce Multilingual automatically creates and synchronizes product variations in all languages. After you create a variation in the default language, save the product (in the default language). WooCommerce Multilingual will immediately create the same variations for all translations of the product. You will see a ‘Variations >>‘ link in the product translation table. This link gives you access to translate various fields in your variations. If you are using different prices for different languages, you will see the variations prices there. You can also translate variation image titles. If your variations use global product attributes, you should translate them in the taxonomy tabs. Once you’ve translated all attributes, you can automatically generate the variations for the translated products.
Similarly to variations, WooCommerce Multilingual automatically synchronizes all images between product translations. This include the featured image, image gallery and all variation images. After you upload or select different images for the product in the default language, save it. All translations of that product will get the same images. You can edit image texts for product translations, by clicking to expand the ‘Images >>‘ section.
This way, you can specify the title, caption and description for the same images in different languages.
When you sell a product, the sale language doesn’t matter for inventory management. Set your inventory in the default language product setting. WooCommerce Multilingual automatically updates your inventory when customer buy in different languages. Same goes for non-textual product attributes, such as size and weight. You need to enter them in the default language only. WooCommerce Multilingual will set them the same for all translated products.
Anything that doesn’t fall inside posts, pages or taxonomy goes into String Translation. This includes the site’s tagline, general texts in Admin screens, widget titles and many other texts.
WPML’s String Translation module is part of the Multilingual CMS package. To enable it, you first need to download and install from your WPML.org account.
Then, go to WPML → String Translation.
Choosing Which Strings to Display
A complex site may contain many strings to translate. Use the display filter, at the top of the String Translation page, to determine which strings to display.
- Which strings to display – choose the translation status (everything, translation complete, translation needed or waiting for translator)
- Strings context – WPML organizes strings into different contexts, making it easier to find a specific string.
- Search – you can enter a search value to narrow down specific strings
Click on the translations link to open the translation editor.
Be sure to click on ‘translation is complete‘ after you translate. Incomplete translations will not appear in the site.
If you are using WPML’s Translation Management module, you can also send strings to translation by your translators.
Click on the checkboxes next to strings, select the language from the list (in the Translation options box) and choose to send to translation. Please note that you cannot choose a specific translator. All translators within a language pair would be able to translate the strings you’ve chosen.
You need to have the standard WooCommerce pages appearing in all languages in your site. WooCommerce Multilingual will do this automatically for you. Go to WPML → WooCommerce Multilingual. You will see a message telling you that the store pages don’t exist, offering to create them.
WooCommerce Multilingual will create these pages with the available translated page titles. You can always change the page titles in different languages later. On this page, you will also see warnings about missing translation for taxonomy terms. If you are using taxonomy for product variations or to organize products into categories and tags, it’s a very good idea to have all taxonomy translated.
WPML lets you translate WordPress menus and create different menus per language. You can translate menus manually, or have WPML synchronize menu content.
Option 1 – Translating Menus Manually
Go to Appearance → Menus.
To translate this menu, click on the + icons next to the other languages. Now, you’re creating a new menu, which will be linked as the translation of this menu.
You can now add pages and categories to the translated menu.
Option 2 – Automatic Menu Sync by WPML
The menu sync tool aims to keep your menus in different languages synchronized. It does so by adding or removing items from the translated menus. This way, any manual edits that you do on the translated menus are kept through the sync process.
To use WPML’s menu sync, go to WPML → WP Menu Sync.
WPML will show you what it’s going to do. You’ll see which entries will be added or removed from the translated menus. Click on the Sync button to perform the selected operations.
If you’ve manually added ‘links’ (custom items) to the menu, you will need to translate their texts in WPML’s String Translation menu. This allows the menu sync tool to recreate your ‘link’ menu entries in the translated menus. Anything you add manually to the translated menus will be preserved throughout WPML sync operation.
Displaying the Translated Menus
In the theme, you can specify the menu in the default language. WPML automatically hooks to the menu system and will display the correct menu in the current language.