WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

As the title says: How would you translate...

  • _n()
  • _n_noop()
  • _nc()
  • _nx()
  • _nx_noop()

...in your .mo files?

share|improve this question
up vote 10 down vote accepted

Step 1

Open your file in PoEdit.

Step 2

Go to "Catalogue" » "Settings"

Step 3

Fill in "Language" and "Country" 1).

Step 4

Fill "Pluralform" (last field).

// For 2 plural forms
nplurals=2; plural=n != 1;

// For 3 plural forms (for e.g. russian), use:
nplurals=3; plural=(n%10==1 && n%100!=11) ? 0 : ((n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20)) ? 1 : 2);

// For 4 plural forms (for e.g. slovenian), use:
nplurals=4; plural=n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3;

Step 4

Go to the 3rd tab "Keywords".

Add the following list. 2) Of course you have to extend to 1,2,3 for languages with three different plural forms and so on.



  • This article from Mark Jaquith may be interesting.
  • Heiko Rabe explains where very well how to work with translation files (german language). He also offers an interesting PDF.


This Plugin by (again) Heiko Rabe does a pretty good job with helping translating your plugin.


1) For e.g. UK & U.S.A. have different forms of "colour/color"

2) Every row goes in a single (new) entry.

share|improve this answer
_nc is deprecated in WP, it's the same as _n – onetrickpony Nov 9 '11 at 15:10
"For e.g. UK & U.S.A. have different forms of "colour/color"" - And many many more. Americans like to spell many words with Z rather than S ;) Hence why the en_GB and en_US locals. – Brady Nov 9 '11 at 15:16
@OneTrickPony Saw _c depreacated and other stuff, but oversaw that one. Thanks. – kaiser Nov 9 '11 at 15:17
"Of course you have to extend to 1,2,3 for languages with three different plural forms and so on." This is not true at all, gettext API remains the same regardless of the translation's language. Read the docs. – Václav Slavík Jul 21 '15 at 12:12

You just need to define the plural form of the language your translating in your PO file (which gets compiled to MO).

For example English has two forms, so your PO file should have two "msgstr" definitions for each string with msgid_plural.

If you're using PoEdit it's easier, just paste the plural form definition in the catalog settings and you'll get extra fields for plural strings...

share|improve this answer
Wasn't that easy. You have to know how to setup the po file... – kaiser Nov 9 '11 at 15:08

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.