How to Translate a WordPress Plugin in Your Language

Translate a WordPress Plugin in Your Language

WordPress is one of the most popular content management systems used across the globe for various types of websites. So to address the audience from varied linguistic regions, WordPress is available in many languages.

language translator WordPress plugin being one of the main components of the WordPress environment, it follows the same approach as well.

WordPress developers who create plugins make sure that they make the app translation ready so it will be easily usable for many languages.

In this post, we’ll check different ways to translate a WordPress plugin in your language based on the actual purpose of your need to translate.

Translate a WordPress Plugin Used in Your Website

In this technique, you can translate an existing WordPress plugin used by your website through the below steps.

1. Login into your WordPress account as admin

2. Install a new WordPress plugin named ‘Loco Translate’. To do this, in WordPress dashboard go to Main Menu -> Plugins -> Add New. Here search for the Loco plugin.

3. Then, install the plugin and activate the same. Now you’ll be able to see the Loco language translator WordPress plugin option in the Menu.

4. Post activation, go to the ‘Loco Translate’ Menu and select the ‘Plugin’ option

5. This will show all the plugins currently in use or activated by your website. From the list choose the one you want to translate.

6. Once selected, the next screen will show you the available readymade languages for translation. If your language is present, select it and then you are done.

7. In case, your language is not present in the existing list select the ‘New language’ button.

8. On this page, you should provide details about your language and also select whether you want to use ‘WordPress language’ or ‘custom language’. Also decision has to be made on where to store the translation files. Once done, click ‘Start translating’.

9. the main task of entering our translation for the various source texts is performed on this screen. Once the translation is entered for all source strings, you’ll have completed translating the WordPress plugin.

Note: Please make sure you save the progress of translation regularly to avoid losing data.

Translate a WordPress Plugin Using Poedit

In this method, we’ll be seeing how to translate a WordPress plugin into your local machine. Gettext translation Apps such as Launchpad, Pootle, GlotPress, and Poedit can be used to achieve this translation. Being the most popular and versatile, we’ll take Poedit to do the translation.

Before starting, you need to make sure the WordPress plugin used for this is already translation-ready. This will be listed in the plugin features and if not present you can always check with the developer once.

So with that prerequisite met, let’s start the translation process

1. First, download the plugin to your local machine and unzip the same. In the extracted folder, you will find a folder named either ‘languages or ‘lang’, open it.

2. You’ll find a file ending with the ‘.pot’ extension in the folder. This is the core translation file and it will be present only if the plugin is already translate-ready. In case, if the file is not present please contact the plugin developer.

3. Now open the Poedit app which is free to use on both Windows and Mac OS.

4. Select ‘File’ -> ‘New catalog from POT file’ option. A catalog properties box will open.

5. Here fill in all the information regarding your translation like Language name, charset, Project name details, and contact email address.

6. The step 4 & 5 are for Mac OS. For Windows users, Go to ‘File’ -> Preferences and fill in your details and contact email address.

7. Then Go to ‘Catalog’ -> ‘Properties’ and provide the language, charset, and Project name details.

8. Once you click ‘OK’, you will be asked to name the new ‘.po’ file. It should be noted that a standard naming convention is followed for this. For eg: if you are translating for the French language the file name of the new ‘.po’ file will be mp-fr_FR.po

A complete guide on this standard for all languages is found here http://www.gnu.org/software/gettext/manual/gettext.html#Language-Codes

9. After saving the file to the language folder, start the translating process by opening the file using Poedit. It’s an easy process where you select a word, enter the translation, and then save the file (Similar to the one followed in the first technique discussed).

10. After all the entries are translated and saved, Poedit will automatically create .po and .mo files in the languages folder. Zip the plugin folder.

11. The final step is to FTP the zip file for it to be installed in your WordPress by using the option under Plugins.

Post installation, for WordPress to identify your language in the translated plugin you need to add the below line of code in your wp_config.php file.

define ( ‘WPLANG’, ‘fr_FR’ )

Translate a WordPress Plugin Directly in WordPress.org

This method of translating a WordPress plugin is a novel gesture to the developer and the WordPress community as a whole. Translation provided this way could actually, make the first two methods redundant or not needed.

Here you use the web-based translation tool hosted by wordpress.org to perform the translation. For this process, you don’t need to have any app or do technical activity.

Just search for the plugin you want to translate at https://wordpress.org/plugins/ website.
Once you go to the Plugin’s home page, under the development option you’ll find an option or link for ‘Translating the plugin into your language’.

When clicked, it will direct you to the ‘Translating WordPress’ page giving the summary of all languages the plugin has already translated and the percentage of stable and in-development status.

Here select the language for which you want to translate, a simple interface with source string and text field to input the translation for specific words is present.

So these are various ways in which you can easily translate a WordPress plugin in your language. Please try it out and let us know your comments.

Sonnal S Sinha

Sonnal S Sinha shares exciting Web development, Web designing, HTML, CMS, WordPress themes, plugins and other WordPress related articles and news for our readers. He also posts selected WordPress developers interviews from time to time.