cedaro / grunt-wp-i18n

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

Warning: Arguments to path.join must be strings #3

Closed grappler closed 10 years ago

grappler commented 10 years ago

I am getting this error:

Running "makepot:target" (makepot) task
Warning: Arguments to path.join must be strings Use --force to continue.
Aborted due to warnings.

I am a grunt beginner but love to get this to work.

This is how my Gruntfile.js looks like.

module.exports = function(grunt) {

    grunt.initConfig({
        makepot: {
            target: {
                domainPath: '/languages',    // Where to save the POT file.
                mainFile: 'flowplayer.php',      // Main project file.
                potFilename: 'flowplayer5.pot',   // Name of the POT file.
                type: 'wp-plugin'  // Type of project (wp-plugin or wp-theme).
            }
        }
    });

    grunt.loadNpmTasks( 'grunt-wp-i18n' );

};
bradyvercher commented 10 years ago

Interesting. I've run into that issue on other projects, but haven't experienced that while working on this one. Your config looks good.

Do you know what version of Grunt you have installed? Also what version of this package are you running? Oh, one more version, too: Which version of Node are you running?

grappler commented 10 years ago

"grunt": "~0.4.1" and "grunt-wp-i18n": "~0.2.0"

bradyvercher commented 10 years ago

Sorry, I made a quick edit to see what version of node you're running: node -v should do it.

grappler commented 10 years ago

v0.10.18

bradyvercher commented 10 years ago

Can you upgrade to the latest versions of node and Grunt and give it a shot? I'm running the latest on Windows, but will give it a go on OSX as well to see if I can replicate this.

grappler commented 10 years ago

I am on Windows 8.

bradyvercher commented 10 years ago

Actually, that's my fault. The readme has the wrong instructions. Try this config instead (notice the options object within the target):

makepot: {
    target: {
        options: {
            domainPath: '/languages',    // Where to save the POT file.
            mainFile: 'flowplayer.php',      // Main project file.
            potFilename: 'flowplayer5.pot',   // Name of the POT file.
            type: 'wp-plugin'  // Type of project (wp-plugin or wp-theme).
        }
    }
}
grappler commented 10 years ago

Great it works :smile: Do you also get PHP strict errors?

bradyvercher commented 10 years ago

Great! Sorry about that and thanks for bringing it to my attention.

The PHP strict errors are from the WordPress i18n tools. I could probably clean them up, but it would make maintaining the fork a little more difficult whenever changes are made upstream. In the meantime, I just disabled strict errors in the php.ini I use for the CLI.

grappler commented 10 years ago

Ok, I created a version that fixes most of errors. https://github.com/grappler/i18n

I tested it and it works