Theme and Plugins Localization in WPML

Theme and Plugins Localization in WPML


In this tutorial, you will learn about translating
the theme and plugin texts with and without WPML String Translation. You will also learn
about translating the WordPress core. Since translating the theme texts is similar
to translating plugin texts, in this tutorial we will illustrate translating theme texts
only. First: Translate the theme texts
without WPML String Translation Go to WPML>Theme and Plugins Localization>Select and save the option “Don’t use String Translation to translate the theme and plugins” With this option, WordPress will automatically
load the .mo file to translate the theme texts like in the single language environment. In this example, I use the theme Twenty Fifteen and the 2nd language is Spanish. Currently I’m in a Spanish search page,
and the string “Search Results for” from the theme is still in English. I am copying the Spanish .mo file with the format name “theme_domain”-”locale”.mo
to the folder: /wp-content/languages/themes. In my case, it’s “twentyfifteen-es_ES.mo”
because the Twenty Fifteen theme domain is “twentyfifteen” and the Spanish locale
is “es_ES”. In the front-end, this string is translated
into Spanish now. Next: Translate the theme texts
with WPML String Translation To use this option, you need to download and
activate WPML String Translation. Then in WPML>Theme and Plugins Localization, choose the option “Translate the theme and plugins using WPML’s String Translation”. In the same screen, click the button “Scan
the theme strings”. Then wait until the theme scan has completed, then
go to WPML>String Translation. Here you can start to translate the theme
texts. For example, I translate the string “Search
Results for: %s”. In the front-end, this string is translated
into Spanish with my recent input. Next: Translate WordPress itself
(or WordPress core) Similarly to translating the theme texts,
there are 2 ways to translate WordPress itself: with or without WPML String Translation. First: translate it without WPML String Translation. Select “I will download translations for
WordPress and save .mo files in wp-content/languages”. Please note that this way is selected automatically if I choose the option “Don’t use String Translation to translate the theme and plugins” above. I’m copying the file es_ES.mo for the WordPress
core to wp-content/languages. In the front-end, the changes happen with
common texts such as month names, box “Comment” and etc. In the back-end, to see the changes, you need to change the admin language to Spanish in your profile. Next: translate the WordPress core
with WPML String Translation. Select “WPML will automatically download
translations for WordPress”. Then to check the available .mo files, click
the link “Check now”. Updated Spanish translation is available,
click the button “Review changes and update”. Scroll down to the bottom and click “Proceed”.
If the number of strings is large, you might wait for some minutes.
After this import process, in the String Translation table, you can see the new imported strings
under the domain “WordPress”. You can easily edit or update your string
translations. For example, I’m going to change the month
name of December. In the front-end, you can see the updated
translation.

Leave a Reply

Your email address will not be published. Required fields are marked *