Translating WordPress/bbPress Plugins

This is a short tutorial with screenshots showing how a user can translate a WordPress or bbPress plugin (which has a POT file, most generally do) in his or her own language. Here, I have taken my bbPress plugin After the Deadline as an example to show how to translate with a software named Poedit. I have chosen Poedit because it has a very simple user interface, and is very easy to use.

Here are the steps:

  1. Download and install Poedit.
  2. Open it. Go to File -> New Catalog from POT file
  3. Select the POT file. It is generally in the root, languages or translations directory of the plugin.
  4. Enter the settings in the dialog box shown.
  5. Enter the path, which is in the same dialog box. Path is the place where is the plugin stored on your local hard disk. In my case it is F:\after-the-deadline.
  6. Write your translations. Here I have translated the plugin into the language hindi.Note: Be careful with the php values, such as %s, %1$s etc. Always include them in the translated string, and in the same order if it is %s and doesn’t include a $ sign! See the screenshot above for an example. Notice that %s is included in both strings.
  7. Save your PO file in the same directory where the POT is stored. Name it as languagecode_COUNTRYCODE. For eg. hi_IN (Hindi is the language and India is the country).
  8. A .mo file would also have been generated. Now notice that my POT’s name is after-the-deadline and my PO’s name is hi_IN. Now you have to rename the .mo file to POT-PO.mo. In my case, the resulted file would be after-the-deadline-hi_IN.mo. You can do the same with the PO file too, if you wish, but it is not necessary.

You have successfully translated the plugin, congrats! If you have translated any of my plugins, please contact me so that I can include the language files in my plugin. If you have any queries, ask them below!

1 comment

  1. I use https://poeditor.com/ to work with wordpress themes and po files. I recommend it to you also, it has a simple interface and many helpful features. Oh, and it has a wordpress plugin attached and github integration also.

Comments are closed.