1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-11-27 08:21:03 +02:00

Tools: Do not process context when running build-translation tool

This commit is contained in:
Laurent Cozic 2021-11-09 15:26:45 +00:00
parent 920f2d9655
commit 3745cd7cb0

View File

@ -166,19 +166,35 @@ async function createPotFile(potFilePath) {
const extractor = new GettextExtractor();
// In the following string:
//
// _('Hello %s', 'Scott')
//
// "Hello %s" is the `text` (or "msgstr" in gettext parlance) , and "Scott"
// is the `context` ("msgctxt").
//
// gettext-extractor allows adding both the text and context to the pot
// file, however we should avoid this because a change in the context string
// would mark the associated string as fuzzy. We want to avoid this because
// the point of splitting into text and context is that even if the context
// changes we don't need to retranslate the text. We use this for URLs for
// instance.
//
// Because of this, below we don't set the "context" property.
const parser = extractor
.createJsParser([
JsExtractors.callExpression('_', {
arguments: {
text: 0,
context: 1,
// context: 1,
},
}),
JsExtractors.callExpression('_n', {
arguments: {
text: 0,
textPlural: 1,
context: 2,
// context: 2,
},
}),
]);