cedaro / grunt-wp-i18n

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

Load Plugin Information according to wish #46

Closed shivapoudel closed 9 years ago

shivapoudel commented 9 years ago
        // Generate POT files.
        makepot: {
            options: {
                type: 'wp-plugin',
                domainPath: 'i18n/languages',
                potHeaders: {
                    'report-msgid-bugs-to': 'https://github.com/axisthemes/axis-builder/issues',
                    'language-team': 'LANGUAGE <EMAIL@ADDRESS>'
                }
            },
            frontend: {
                options: {
                    potFilename: 'axisbuilder.pot',
                    exclude: [
                        'api/.*',
                        'tmp/.*',
                        'tests/.*',
                        'includes/admin/.*'
                    ],
                    processPot: function ( pot ) {
                        pot.headers['project-id-version'] += ' Frontend';
                        return pot;
                    }
                }
            },
            admin: {
                options: {
                    potFilename: 'axisbuilder-admin.pot',
                    include: [
                        'includes/admin/.*'
                    ],
                    processPot: function ( pot ) {
                        pot.headers['project-id-version'] += ' Admin';
                        return pot;
                    }
                }
            }
        },

But, while looking after the transifex, I figure out that plugin information for the both pot files are generated. How can I generate plugin information for axisbuilder-admin.pot and not for the axisbuilder.pot as localization is done in admin and frontend respectively by each mo files generated by grunt-potomo.

bradyvercher commented 9 years ago

Hi @shivapoudel, I'm not totally clear, but I assume you're wanting the strings for the plugin headers to only be included in the admin POT file? If so, these docs might help remove them from the POT file for the frontend.

shivapoudel commented 9 years ago

Utilizing processPot callback to control plugin meta data really fix this xD