[wp-hackers] I18n for plugins

Rich Pedley elfin at elfden.co.uk
Thu Feb 3 15:12:30 UTC 2011


on http://codex.wordpress.org/I18n_for_WordPress_Developers

it says:
# If your plugin is registered in the official repository, go to your 
Admin page there and scroll to Generate POT file.

# If your plugin is not in the repository, you can checkout the 
wordpress-i18n tools directory from SVN

So presumbably  the built in POT generation uses those scripts?

I've been having some problems in my plugin and translators unable to 
translate a call that used _n
eg:
sprintf(_n('<span>%d</span> product in cart.','<span>%d</span> 
products in cart.',$eshopsize,'eshop'),$eshopsize);

Using Poedit, it wasn't keeping the plural form when I do an update. 
Using the online one does include the correct plural:

#: eshop-widget.php:44 eshop-widget.php:164 eshop-shortcodes.php:44
msgid "<span>%d</span> product in cart."
msgid_plural "<span>%d</span> products in cart."
msgstr[0] ""
msgstr[1] ""

but does not add what I think to be a necessary header - ie.
"Plural-Forms: nplurals=2; plural=1;\n"

(or similar)

am I correct in thinking that that header should be in the POT file?

Rich


More information about the wp-hackers mailing list