0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-11-25 13:10:14 +01:00
wagtail/client/extract-translatable-strings.js
LB (Ben Johnston) 7c9b6fd415
Cleanup - eslint config fixes (#8543)
Co-authored-by: Thibaud Colas <thibaudcolas@gmail.com>
2022-05-20 16:08:13 +01:00

32 lines
684 B
JavaScript

const { GettextExtractor, JsExtractors } = require('gettext-extractor');
const extractor = new GettextExtractor();
extractor
.createJsParser([
JsExtractors.callExpression('gettext', {
arguments: {
text: 0,
context: 1,
},
}),
JsExtractors.callExpression('gettext_noop', {
arguments: {
text: 0,
context: 1,
},
}),
JsExtractors.callExpression('ngettext', {
arguments: {
text: 1,
textPlural: 2,
context: 3,
},
}),
])
.parseFilesGlob('./src/**/*.@(ts|js|tsx)');
extractor.savePotFile('../wagtail/admin/locale/en/LC_MESSAGES/djangojs.po');
extractor.printStats();