cedaro / grunt-wp-i18n

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

Exclude doesn't included in .pot file #70

Closed widoz closed 7 years ago

widoz commented 7 years ago

Hi, probably my bad but I unable to set the exclude dir list. here the options list.

makepot: {
            dist: {
                options: {
                    cwd: './',
                    domainPath: 'languages/',
                    exclude: [
                        'bower_components/.*',
                        'node_modules/.*',
                        'vendor/.*',
                        'assets/.*'
                    ],
                    include: [],
                    mainFile: 'index.php',
                    potComments: '',
                    potFilename: 'plugin-name.pot',
                    potHeaders: {
                        poedit: true,
                        'Project-Id-Version': 'Plugin Name',
                        'POT-Creation-Date': '2017-09-06 13:08+0200',
                        'PO-Revision-Date': '2017-01-08 19:27+0100',
                        'Last-Translator': '',
                        'Language-Team': '',
                        'Language': 'en',
                        'MIME-Version': '1.0',
                        'Content-Type': 'text/plain; charset=UTF-8',
                        'X-Poedit-Basepath': '../',
                        'Plural-Forms': 'nplurals=2; plural=(n != 1);',
                        'X-Poedit-KeywordsList': true
                    },
                    processPot: null,
                    type: 'wp-plugin',
                    updateTimestamp: true,
                    updatePoFiles: true
                }
            }
        },

I expecting to view a list like this

"X-Poedit-SearchPathExcluded-0: bower_components\n"
"X-Poedit-SearchPathExcluded-1: node_modules\n"
"X-Poedit-SearchPathExcluded-2: vendor\n"
"X-Poedit-SearchPathExcluded-3: assets\n"

it's right?

diggy commented 7 years ago

There's some trouble with this module, cf. https://github.com/wp-cli/scaffold-command/pull/51

bradyvercher commented 7 years ago

Hi @widoz, the exclude option prevents this module from scanning those particular directories, so any strings in them shouldn't be added to the POT file. It doesn't add X-Poedit-SearchPathExcluded-* headers, so if those are necessary, you can add them using the potHeaders option.

@diggy Is the issue you linked to a problem with this module? Or is it a configuration issue in that command? If there's a problem that needs to be addressed here, can you open a new issue?