Skip to content
This repository was archived by the owner on Sep 29, 2025. It is now read-only.
This repository was archived by the owner on Sep 29, 2025. It is now read-only.

Can't extract comments #89

@SeanHayes

Description

@SeanHayes

Using react-gettext-parser 1.16.0

Snippet form my gulpfile.js


        process.chdir(`${localesDir}templates/LC_MESSAGES/`);
        gulp.src(paths.scripts.src.map((path) => {
            return `../../../${path}`;
        }))
            .pipe(reactGettextParser({
                output: 'messages.pot',
                funcArgumentsMap: {
                    gettextSub: ['msgid', 'comment'],
                    gettextSubComponent: ['msgid'],
                    gettext: ['msgid'],
                    dgettext: [null, 'msgid'],
                    ngettext: ['msgid', 'msgid_plural'],
                    dngettext: [null, 'msgid', 'msgid_plural'],
                    pgettext: ['msgctxt', 'msgid'],
                    dpgettext: [null, 'msgctxt', 'msgid'],
                    npgettext: ['msgctxt', 'msgid', 'msgid_plural'],
                    dnpgettext: [null, 'msgid', 'msgid_plural'],
                },
            }))
            .pipe(gulp.dest('.'))
            .on('error', reject)
            .on('end', resolve);

Snippet of code I'm trying to translate:

        // Translators: alt img text for a flag icon. This icon is used to allow users to flag content as being inappropriate.
        const altText = gettextSub('flag icon', 'a comment');

Neither "alt img text..." or "a comment" is extracted to my .pot file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions