Internationalization and the plugin description

SO I am trying to do some i18n on a plugin I am working on and having some troubles. I wanted to see if anyone else has encountered these or possibly has a solution.

Basically, I have received the plugin translation and it all looks great except for one thing: the plugin description. I tried adding into the plugin header Text Domain and Domain Path, but I cannot figure out how to get this into the .pot file for translation.

Read More

I examined a couple of plugins ( WooCommerce and Easy Digital Downloads) and I noticed that both have the string in their .pot files and it doesn’t seem like they are doing anything special to get them there. I was trying this with Poedit and could not figure it out. The one thing I have not tried and maybe this will solve it is using the make .pot from WordPress, will that add in the description?

On another note with the Text Domain in the header (even for WooCommerce) I noticed that the plugin description does NOT get translated unless the plugin is actually active. Is that an issue with WordPress or is it just being done wrong?

Sorry for the long post and thank you to anyone who can contribute!o

Related posts

2 comments

  1. You need to be using WP’s own tools (makepot.php) for creating POT files for header to be properly scanned and included, see Generating a POT file in Codex.

    For plugin details to be translated when inactive its header should include properly set up text domain and path to translations folder (if necessary).

    1. Download the zip from https://github.com/wp-mirrors/wp-i18n-tools.
    2. Extract its content into the wp-includes folder.
    3. Command line one-liner from within WP root: $ php wp-includes/makepot.php wp-plugin wp-content/plugins/MYPLUGIN/ wp-content/plugins/MYPLUGIN/MYLANGFOLDER/MYPLUGIN.pot
    4. Then you take this resulting .pot file as source for Poedit.
    5. Finally ensure to name the .mo/.po like your plugin plus language code, for example: MYPLUGIN-de_DE.mo/MYPLUGIN-de_DE.po.

Comments are closed.