cedaro / grunt-wp-i18n

Internationalize WordPress themes and plugins with Grunt.
MIT License
160 stars 25 forks source link

Add an option to include common Poedit headers #28

Closed bradyvercher closed 9 years ago

bradyvercher commented 10 years ago

Given that Poedit is one of the more popular tools that people use to translate WordPress projects, adding a few headers to make that process easier without using the error-prone processPot() callback seems worthwhile.

A quick search turns up that WordPress SEO seems to be the most forked project on GitHub using grunt-wp-i18n (thanks @defries!) and they've defined some commonly-used headers.

Obviously this would be toggled on with an option and could still be updated in the processPot() callback, but it could help standardize a few tricky headers like the keyword list and reduce boilerplate in Gruntfile.js for anyone who wants to make working with their POT files a little easier.

I'm considering these for the default values:

{
    'language': 'en',
    'plural-forms': 'nplurals=2; plural=(n != 1);',
    'x-poedit-country': 'United States',
    'x-poedit-sourcecharset': 'UTF-8',
    'x-poedit-keywordslist': '__;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;_n_noop:1,2;_c;_nc:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;',
    'x-poedit-basepath': '../',
    'x-poedit-searchpath-0': '.',
    'x-poedit-bookmarks': '',
    'x-textdomain-support': 'yes'
}
remkus commented 10 years ago

WFM :)

shivapoudel commented 10 years ago

Great :+1: please be soon.

shivapoudel commented 10 years ago

@bradyvercher Bump the version soon in npmjs.org I am hungry for this from six months in my project.

bradyvercher commented 10 years ago

@shivapoudel I'll try to get this out the door as soon as I can, just need to write some tests and documentation first.