From 47ada39b1618650dce30042ad230b1087fa9e173 Mon Sep 17 00:00:00 2001 From: Ivan Velev Date: Mon, 7 Feb 2022 18:59:25 -0800 Subject: [PATCH] vue ui i18n: fixed bug: if multiple embedded named strings in localized string must replace ALL (use global regex flag) --- pywb/vueui/src/i18n.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pywb/vueui/src/i18n.js b/pywb/vueui/src/i18n.js index 49020209..151c8917 100644 --- a/pywb/vueui/src/i18n.js +++ b/pywb/vueui/src/i18n.js @@ -27,7 +27,7 @@ export class PywbI18N { getText(id, embeddedVariableStrings=null) { const translated = decodeURIComponent(this.config[id] || id); if (embeddedVariableStrings && id.indexOf('{') >= 0 && id.indexOf('}') >= 0 ) { - return translated.replace(/{(\w+)}/, (match, stringId) => embeddedVariableStrings[stringId]); + return translated.replace(/{(\w+)}/g, (match, stringId) => embeddedVariableStrings[stringId]); } return translated }