Turning your WordPress site multilingual with WPML and the Customizr theme
The current documentation will help you quickly install and setup one of the best multilingual plugin for WordPress named WPML. This article cover the following topics
- How to install WPML ?
- How to translate a post or a page?
- How to translate a slider?
- How to translate the featured pages?
- How to translate the widgets?
- How to translate the menus?
So, you have a WordPress site. Your have followers from various countries. You want to make some of your international followers at home by offering your site in their preferred language as well.
It is at this juncture that WPML serves as an option. WPML is a multi-language plugin. It provides a way to reproduce your content in the primary language in one or more other languages. The content that is made available in multiple languages can be a few posts or entire site.
WPML comes bundled with 40 languages pre-installed. In addition, you can add more languages. It comes with a language switcher widget which makes switching between various language versions of the site easy.
The first step towards installation of WPML is to head to https://wpml.org/ and purchase the premium plugin.
Now, you need to manually download it and install.
- Log in to your WPML.org account.
- Click on Downloads.
- Download the WPML components that you need. These are zip files. The main components that you need are
- WPML Multilingual CMS (the core component)
- WPML String Translation (add-on)
- Optionally, if you plan to use any tools for translation, then you can download WPML Translation Management (add-ons here)
- If your site is media rich and you plan for translation of these as well, then install WPML Media as well.
- After downloading required components, head to your WordPress site, login as admin.
- From the dashboard, click on Plugins > Add New. Click on Upload Plugin. From the Add Plugins screen that you get, click on Browse button. Choose the zip file and click on Install Now. Repeat this process for each component. Ensure that you install the core component first.
After installation, you have to set up the languages. Click on WPML > Languages and you will see the setup screen.
- The first screen shows the Current content language which by default in English. Choose the current language from the drop-down list and click on Next.
- Select one or more languages as target languages. For the purpose of this tutorial, it is French. Click on Next.
- The third screen shows options for the language switcher widget. You can choose from the following options and preview the widget. After choosing from options, click on Next.
- where you want the widget to be placed
- the order of the languages in the widget
- the style of the widget
- what to include in it - language name in current language, language name in that language and flag
- other options
- The last screen is where you have to enter the site key. For this, you need to register your site with WPML. Get the site key after registration and enter it here. Click on Finish.
For settings, from the WordPress admin dashboard, click on WPML. You will see options under various sections:
- Site Languages
- Language URL Format
- Language switcher options
- Admin Language
- Blog posts to display
- Hide languages
- Make themes work multilingual (Ensure that you check against Adjust IDs for multilingual functionality)
- Browser language redirect
- SEO options
- WPML Love
Most of the options are self-explanatory. For more details check https://wpml.org/documentation/getting-started-guide/language-setup/.
How to translate a post or a page?
Translating a post or a page involves the same sequence of actions. Click on Posts / Pages to see the list available in the current language.
You will see a column with a flag on top for each target language added. There is a + symbol against the post under this column. Click on this to edit the target language content for this post or page.
Alternately, you can also open (edit) the current language post/page. Here, you will find a metabox title Language. Click on the + symbol against the target language in this metabox to edit the target language content.
Now the editor shows up where you can enter the content in target language and publish it.
Visit your site and go to the particular post/page that you translated.
Click on the language switcher widget and choose the target language. You should see the translated post/page appear.
Very simple, do you think so?
How to translate a slider?
Before you go ahead with the slider translation, ensure that you have installed WPML Media Component according to instructions given in the Installation section.
Setup WPML Media
After installation, go to WPML > Media Translation. You find a screen with a few options. The default choices can be left as is. Click on Start button so that existing media is made ready for translation. Click on the Apply button in the How to handle media for new content section. If you get a success message at the bottom, now all your media will have a language associated with it.
Translate images of the slider
If you do not have the images for the slider already uploaded, upload them. Go to Media > Library and edit the first image of the slider. Create the slider and add the image to the slider.
After you are done with entering caption, alternate text, description and other texts for the image in the current language, click on Update. Now, click on the language switcher in the admin bar on top. Switch to the target language.
Enter the text associated with the image in the target language as well. Click on Update.
Repeat this process for each image that you want to add to the slider.
Adding slider to a page
Add/Edit the page in which you want this slider. Write the content for the page in the current language. Add the slider to the page. Publish it.
Translate this page in the target language according to the section How to translate a post or a page? Add the slider to the target language page as well and publish it.
Visit this page on your site and see it in action in the current language.
Switch the language and see the translated slider images.
For more details on media translation do check this page as well: https://wpml.org/documentation/getting-started-guide/media-translation/
How to translate the featured pages?
Before you go ahead with this, ensure that the version of Customizr you use is 3.1.15+. If it is not so, upgrade it.
Choose the pages that you want to add as Featured pages. Translate them following the section How to translate a post or a page. Create Featured pages using the current language pages. Visit the site and see the featured pages in current language.
Switch to the target language. You will see that the featured pages are automatically substituted with the corresponding target language pages.
How to translate the widgets?
For translating widgets, go to WPML > String Translation. Here, you will find the Widget strings listed. Click on translations against each widget string. Enter the translation. check against Translation is complete and click on Save.
Visit your site and look at the widgets.
Switch to the target language and view the translated widgets.
How to translate the menus?
For translating menus, go to Appearance > Menus. Create the menu in current language. Save it.
Click on Translations for the target language. Create another menu for the target language. Note that the language of this menu is the target language. You will note that all pages, posts in the target language are listed. Add the corresponding pages in the target language to this menu and save it.
Visit your site and see the menu in current language.
Switch the language and view the menu that is translated.
That completes the translation of all components of your site. Now sit back and watch your international followers grow. You will find that it is worth all the effort.