All our plugins and theme have multi-language support. To create new translation, best program available is POEdit, a free program that will help you create valid translation files. This program will help you create translation, and later update it when the new version is released.
Step 1: Installing the POEdit
You need to download latest version of the program from: http://www.poedit.net/. Installation is simple much like any other program. There are versions for Windows, Linux and Mac OS so you can work on any platform 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 language 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 latest POT file with all the strings in the current plugin version, and will use this plugin as an example. 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 original string, and the other for your translated string. Right click on any string in the list, will show you comments for that string, and usually 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 embedded 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:
As you can see, main part is the same as the name of POT file, than you add minus sign and after that language code. Full list of these codes can be found here: http://codex.wordpress.org/WordPress_in_Your_Language. All our plugins and themes use this naming convention.
Step 5: Setting for plural forms
This is a step dependent on the language you translate into. For most languages, there is a singular and plural words (2 plural forms). Some, like Russian have 3. Before you start translating, you need to set this first. When you create empty translation, or you want to change existing to support plurals, open Catalog menu, and in that menu open Settings. You need to fill plural form part. For most languages this is:
nplurals=2; plural=n != 1;
To get more info on the subject, check out this post: Translating Plural Forms with Poedit.
Once you set plural form, when you get to translate plural word, main POEdit form will look a bit different, as shown on the image on the left, with singular and plural boxes and two form elements to translate them.
Step 6: 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.