Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for PoEdit. #4

Closed
wants to merge 1 commit into from
Closed

Added support for PoEdit. #4

wants to merge 1 commit into from

Conversation

pixel-industry
Copy link

Hi,

Thanks for nice plugin. I am using it to generate .pot files for our themes but when generating using this plugin, I need to manually enter PoEdit specific parameters. PoEdit is very popular translation tools so I though about adding support by adding options to plugin for three specific parameters ("keywords", "base" and "search path") that will be automatically added to the header of .pot file.

This allows updating .pot file from PoEdit (Cataloque ->Update from sources) for those who changed theme files and don't have access to gulp (most non-devs).

So I added PoEdit support to your plugin. It adds three lines mentioned above to header. It should be used like below:

gulp.task('default', function () {
    return gulp.src('src/file.php')
        .pipe(wpPot( {
            domain: 'domain',
            destFile:'file.pot',
            package: 'package_name',
            bugReport: 'http://example.com',
            lastTranslator: 'First Last <mail@example.com>',
            team: 'Team <mail@example.com>',
            poEdit: {
                keywordsList: '_;gettext;gettext_noop;__;_e;esc_attr_e;esc_html_e',
                basePath: '.',
                searchPath: '..'
            }
        } ))
        .pipe(gulp.dest('dist'));
});

If "keywordsList" is not set, default will be used:

__;_e;esc_attr__;esc_attr_e;esc_html__;esc_html_e;_x;_ex;esc_attr_x;esc_html_x;_n;_n_noop;_nx;_nx_noop

I think this is nice addition for those who need quick compatibility with PoEdit.

Vladimir

@rasmusbe
Copy link
Collaborator

Thank you for PR, I think it's a good idea to add support for custom headers in the file.

But I can't merge this since you have change the code syntax (that's why the tests are failing) and you are committing the files from your editor that should not be included in this project.

Please use an editor that can read .editorconfig (or follow it manually) and add files from your editor to your global gitignore (NOT the gitignore in this repo)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants