diff options
author | Lucie Gérard <lucie.gerard@qt.io> | 2024-01-12 16:36:20 +0100 |
---|---|---|
committer | Lucie Gérard <lucie.gerard@qt.io> | 2024-01-17 10:43:45 +0100 |
commit | e92e844a570874ab38a6204787667da8d087480b (patch) | |
tree | 638cfa6cfb0605679414ac8f0935263a50ad8ab6 /src/linguist/lupdate/qdeclarative.cpp | |
parent | e96c9e98bc4004063fa93dcf9ccce4997ddb1fdd (diff) |
lupdate: Add support for template literal as translation source in qml files
Task-number: QTBUG-120531
Pick-to: 6.6 6.7
Change-Id: I8a4ede2e1fbd79e4764e4ef3438e18d7d73ee204
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'src/linguist/lupdate/qdeclarative.cpp')
-rw-r--r-- | src/linguist/lupdate/qdeclarative.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/linguist/lupdate/qdeclarative.cpp b/src/linguist/lupdate/qdeclarative.cpp index 93ab76f9e..e62cfec15 100644 --- a/src/linguist/lupdate/qdeclarative.cpp +++ b/src/linguist/lupdate/qdeclarative.cpp @@ -96,12 +96,6 @@ protected: .arg(name)); return; } - if (AST::cast<AST::TemplateLiteral *>(node->arguments->expression)) { - yyMsg(identLineNo) - << qPrintable(QStringLiteral("%1() cannot be used with template literals. " - "Ignoring\n").arg(name)); - return; - } QString source; if (!createString(node->arguments->expression, &source)) @@ -232,6 +226,9 @@ private: if (createString(binop->right, out)) return true; } + } else if (AST::TemplateLiteral *templit = AST::cast<AST::TemplateLiteral *>(ast)) { + out->append(templit->value); + return true; } return false; |