subscribe: Posts | Comments | Email | Twitter     external: Forum | Issue Tracker

Translating plugin using POEdit

1 comment
Translating plugin using POEdit

GD Star Rating has multilanguage support. However, number of languages included depeneds on people who are willing to translate the plugin to their language. POEdit is a free program that will help you create valid translation files. This program will help you translate plugin, and later update translation when the new version is released.

Step 1: Installing the POEdit

You need to download latest version of the program from: Installation is simple much like any other program. There are versions for Windows, Linux and MacOS so you can work on any patform with it.

Step 2: Creating new translation project

In File menu you have option ‘Create catalog from POT file’. Dialog will appear and you need to give it POT file you want to translate. Program will ask you for the project info, and here you can add info about project, translation langauge and yourself. After that you need to save catalog. You can use default name for now, we can rename file later. And, now if POT file is valid, you will see the list of translation strings. If the POT file is not valid you will get information about errors.

GD Star Rating always includes lates POT file with all the strings in the current plugin version. This file is: gd-star-rating.pot and is in the main plugin folder.

Step 3: Translating

This is pretty obvious, you need to translate all strings. Below the list, you will see two two fields, one with orginal string, and the other for your translated string. Right click on any string in the list, will show you comments for that string, and ususally that is location of the string in the original files, in our case plugin or theme. You can also copy value of original string into translated string.

Important: Don’t translate %s you found embeded in the strings for translation, just leave them. They represent some other value added by the plugin or theme code, usually numbers or something else.

Step 4: Proper naming of translation files

Once you complete translation, you need to save it. Program will generate two files. One with extension MO and other PO. Both files should have the same name, only different extension. Name of the file also need to have a language code. So, here is the example of proper named files for serbian translation:

  • gd-star-rating-sr_RS.po

As you can see, main part is the same as the name of POT file, than you add – and after that language code. Language code always looks like that, and full list of these codes can be found here:

Step 5: Updating the translation

When the plugin POT files is updated, you need to update your translation files. Once you receive new POT file, you need to open PO file of your translation (‘gd-star-rating-sr_RS.po’) in POEdit and use ‘Update from POT file’ option in ‘Catalog’ menu. Point to POT file, and program will show you what is new and will add this new strings for you to translate. Also, will show you what is became obsolete, and will remove old and no more needed strings from your translation. Program will try to recognize the changes and offer you the ‘fuzzy’ translation.

And that’s it. You can send me translation files so I can include it with the plugin.

GD Star Rating
a WordPress rating system
Translating plugin using POEdit8.31029