Skip to content

Can't extract comments #89

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions