This repository was archived by the owner on Sep 29, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27
Can't extract commentsΒ #89
Copy link
Copy link
Open
Description
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.
olof-nord and vixalien
Metadata
Metadata
Assignees
Labels
No labels