The following tutorial Create a WordPress plugin or theme translation using poedit shows you how to create or edit a language file for WordPress themes and plugins.
For this example the language files created or edited are Spanish. Typical Spanish language files created might look like es_ES.po and es_ES.mo file.
Note: Nowadays most plugins and themes are translated online at translate.wordpress.org/.
What you need:
- And ftp program like filezilla which is free or cpanel File Manager
- Poedit to edit or create new po and mo files.
- Loco Transtale is becoming very popular. (Optional)
Create a WordPress plugin or theme translation using poedit
Step 1 ) Open Poedit in your computer or laptop. Click on Open button and locate your po file to edit. In this example I am going to edit es_ES.po from Suffusion theme. See image below.
Step 2 ) Once you have opened the es_ES.po file you will see many strings for editing. Each string will be displayed under Source text: once you have selected the string. This string will allow you to add your Spanish translation under Translation: field. See image below.
Note: In your case you might be translating a different language.
Step 3 ) Locate the Source text you wish to edit and click on the text. This text string will display below for editing.
In the following image Center is being edited. The word Centrar will be edited to a different translation.
Step 4 ) In the following image you can see the changes to El Centro or you can simply type Centro. Of course you can make any changes that suit your needs. This method of using Poedit allows you to make your translation more personal.
Completed Po Changes
Step 5 ) Once you have completed all the changes, click on Save. See image below.
Upload Files To Server
Step 6 ) After saving your changes, go back to the source, “The location where you opened the file to edit”. You should see the following two files with updated entries.
The es_ES.mo file is generated automatically by Poedit when you save the changes made to your po file. Once you have completed all your changes and saved your file, you need to upload the new files back to your server using FTP.
Note: Make sure you refresh your browser and delete your cache if you have a cache plugin installed in your site.
That is how simple it is to make changes or create new files for your WordPress plugins or theme.
I keep updating this tutorial form time to time so come back soon to check the latest.
If you have any questions please let me know.