mirror of
https://github.com/wagtail/wagtail.git
synced 2024-11-29 01:22:07 +01:00
33 lines
751 B
JavaScript
33 lines
751 B
JavaScript
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||
|
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|jsx)');
|
||
|
|
||
|
extractor.savePotFile('../wagtail/admin/locale/en/LC_MESSAGES/djangojs.po');
|
||
|
|
||
|
extractor.printStats();
|