Creating a multi-language website

It’s good to know that hav­ing a mul­ti-lan­guage web­site involves a bit of effort, but there are also great perks that pay off. For exam­ple, you can increase your search traf­fic up to 47% by mak­ing your web­site avail­able in more than one lan­guage. Not bad, right?

If your web­site can be a good source of infor­ma­tion for users that don’t know the main lan­guage, it’s a loss not to make it acces­si­ble for them too. If you invest a lot of time and ener­gy to write valu­able con­tent, then you should also try to make it avail­able as it can be. In the end, you want to share.

You should know that chang­ing the web­site lan­guage from the dash­board area is not enough. Your website’s struc­ture is formed of dif­fer­ent parts of posts, pages, menus or wid­gets. The con­tent of those sec­tions can be added direct­ly to your lan­guage. How­ev­er, there are strings attached, both from the theme and plu­g­ins, that you need to trans­late. Let’s take the fol­low­ing sce­nario: you have a blog web­site, and at the end of each arti­cle you can have a Read more part. Those spe­cif­ic words should be trans­lat­ed into your native lan­guage in order to facil­i­tate access.

The .PO file includes the orig­i­nal texts and the trans­la­tions in two columns. The .MO file incor­po­rates the exact same con­tents as PO file. Keep in mind that the two files dif­fer in their for­mat. While a PO file is easy for humans to read, MO files are com­piled and very easy for com­put­ers to read. Nonethe­less, Word­Press gets trans­la­tions from the .MO files.

Here are the steps you have to take in order to trans­late your web­site:

  1. Install and acti­vate the core WPML plu­g­ins;
  2. Con­fig­ure WPML (see the Get­ting Start­ed Guide) by select­ing your default lan­guage, a set of active lan­guages, and a lan­guage selec­tor.
  3. Trans­late all the ele­ments of your web­site:
    1. Con­tent of your pages, posts and oth­er cus­tom ele­ments (eg. projects);
    2. Menus;
    3. Wid­gets;
    4. Each lan­guage needs its own pair of files. In order to do this, please fol­low these steps for each lan­guage you want to have your web­site trans­lat­ed to:
      1. Go to this link;
      2. Select the theme that you are using;
      3. Click on the lan­guage you would like to trans­late your web­site;
      4. You can sug­gest a new trans­la­tion for any of the Eng­lish orig­i­nal strings, seen on the left. Just click on Details but­ton from the end of the line and add your sug­ges­tion;
      5. Once you fin­ished your trans­la­tion, go to the bot­tom of the page and select to Export all cur­rent as Portable Object Mes­sage Cat­a­log (.po);
      6. You need to export one more file, the Machine Object Mes­sage (.mo), the same way you did on step 6;
      7. Go to this link;
      8. Find the WP Locale for the lan­guage you want to trans­late your web­site into.
      9. Rename both PO and MO files this way: themename-locale.po and themename-locale.mo. For exam­ple, if the theme is called Julia and you want to trans­late it in French, your files will be called julia-fr_FR.po and julia-fr_FR.mo;
      10. Upload the trans­la­tion files, through FTP:
        1. The theme trans­la­tion files need to be added to wp-con­tent/lan­guages/themes fold­er;
        2. The plu­g­ins trans­la­tion files need be added to wp-con­tent/lan­guages/­plu­g­ins fold­er.
        3. The plu­g­ins for cre­at­ing the PO/MO files. You can find some more details here.
    5. Any­thing that doesn’t fall inside posts, pages or tax­on­o­my goes into String Trans­la­tion. This includes the site’s tagline, gen­er­al texts in Admin screens, wid­get titles and many oth­er texts. You can find some fur­ther info about this right here.

    FAQs

    Are your themes compatible with WPML?

    Yes — here is the offi­cial list of WPML cer­ti­fied themes.

Updated on November 16, 2017

Was this article helpful?