Current User: Guest
Please consider registering

 
Search Forums:


 




How to translate a WordPress Plugin

Post

Aaron - Admin

11:19 am - April 22, 2009

posts 382

 
1

Translating a WordPress plugin is fairly easy -- except for the translating part. The easiest and most popular program to use to translate is called PoEdit and works on most operating systems including Windows, Linux, UNIX, or Mac OS X.

Translation is fairly simple. There are three types of files .pot, .po and .mo used in translations. The .pot file is just a list of phrases in the plugin that need to be translated. The .pot file is never edited directly it is just used to create a .po file which is edited to match a translation with its original phrase. The .mo file is a compressed/encoded version of the .po file which is what the server actually uses for translating. You won't ever need to translate a file by hand, but the basic file is set up as follows where the first line shows where the text "Cancel Reply" is found, and the third line is the translation of the text.

#: /share/www/trunk/wp-content/plugins/ajaxd-wordpress/modules/inlinecommentform/inlinecommentform.php:457
msgid "Cancel reply"
msgstr "Cancelar"

To translate:
1. Run PoEdit
2. Download the latest AJAXed WordPress .pot file from the repository.
3. In the menu select File -> New catalog from POT file…

You may want to edit the header, but this is not required. The header should look like

Project name and version: AJAXed WordPress VERSION Japanese
Team: YOURNAME
Team’s email address: YOUREMAIL
Language: Select your language.
Country: Select your country.
Charset: UTF-8(not change)
Source code charset: UTF-8
Plural Forms: Set blank.

4. Save the file as aWP-xx_XX.po where xx is your WPLANG (French -> fr, Japanese -> ja, etc).
5. Start translation.

NOTE: if you want, you can use a normal text editor, but you must save the file as a UTF-8.

If you are using Unix on GUI, you can also use PoEdit like Windows and Mac. or, If you are using Unix on CUI, you can use one of the following applications to translate:

xgettext, msginit, msgfmt, and msgmerge (gettext package), editor(vi, emacs, etc..)

1. you change directory(translations).
2. # msginit -l YOURLANG(on UNIX) -i aWP.pot -o aWP-xx_XX.po
Example: # msginit -l ja_JP.UTF-8 -i aWP.pot -o aWP-ja.po
3. edit aWP-xx_XX.po
4. # msgfmt -v -c aWP-xx_XX.po -o aWP-xx_XX.mo

When you finish translating, save the po/mo files in the aWP/translations directory. To have the files included in the plugin itself, zip, tar or rar the files and send them to Aaron at admin@anthologyoi.com.

kevin - Guest

5:07 pm - September 22, 2009

 
2

Hey Aaron,

that might be a dummy question but i just cant figure out how to change the language of the plugin. I downloaded it, it got various translated languages files but i cant see how to activate one of them.

Thanks in advance, i'm really interested in the plugin.

Aaron - Admin

9:21 pm - October 5, 2009

posts 382

 
3

It is based on the wordpress language setting, but there is an option under the "overall options" tab that allows you to force wordpress to use a certain translation.

Milad - Guest

4:30 pm - October 11, 2009

 
4

So TnX



Reply to Topic: How to translate a WordPress Plugin

Name (Required):

EMail (Required):

Website):

Topic Reply:

HTML Editor
Save New PostSmileysOptions

Guest URL (required)

Math Required!
What is the sum of:
7 + 11
   

 
Confused Cool Cry Embarassed Frown Kiss Laugh Smile Surprised Wink Yell

 
 

About the Ajaxed WordPress forum

Most Users Ever Online:

35


Currently Online:

9 Guests

Forum Stats:

Groups: 1

Forums: 4

Topics: 173

Posts: 462

Membership:

There are 193 Members

There have been 135 Guests

There is 1 Admin

There are 0 Moderators

Top Posters:

fromgrannie - 5

jakemc - 5

tombyrnes - 4

Siam - 4

flash - 4

BAM - 4

Administrators: Aaron (382 Posts)