Skip to content

Commit

Permalink
Merge pull request #4945 from kobotoolbox/allow-concat-in-frontend-t-…
Browse files Browse the repository at this point in the history
…string-sources

Allow concat in frontend t()-string sources
  • Loading branch information
jnm committed May 23, 2024
2 parents 0c9cb17 + bc83a21 commit b3e7b7d
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 27 deletions.
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
"webpack-cli": "^4.9.2",
"webpack-dev-middleware": "^5.3.1",
"webpack-dev-server": "^4.8.1",
"webpack-extract-translation-keys-plugin": "^6.0.0"
"webpack-extract-translation-keys-plugin": "^6.1.0"
},
"overrides": {
"reflux": {
Expand Down
19 changes: 0 additions & 19 deletions patches/webpack-extract-translation-keys-plugin+6.0.0.patch

This file was deleted.

22 changes: 22 additions & 0 deletions patches/webpack-extract-translation-keys-plugin+6.1.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
diff --git a/node_modules/webpack-extract-translation-keys-plugin/index.js b/node_modules/webpack-extract-translation-keys-plugin/index.js
index 50da46c..962c104 100644
--- a/node_modules/webpack-extract-translation-keys-plugin/index.js
+++ b/node_modules/webpack-extract-translation-keys-plugin/index.js
@@ -115,7 +115,7 @@ ExtractTranslationPlugin.prototype.apply = function(compiler) {
}

key = parser.evaluateExpression(expr.arguments[0]);
- if (!key.isString()) {
+ if (key.string === undefined) {
parser.state.module.errors.push(
new DynamicTranslationKeyError(
parser.state.module,
@@ -127,7 +127,7 @@ ExtractTranslationPlugin.prototype.apply = function(compiler) {

key = key.string;

- let value = expr.arguments[0].value;
+ let value = key;

const entry =
reverseEntryPoints[

0 comments on commit b3e7b7d

Please sign in to comment.