mirror of
https://github.com/webrecorder/pywb.git
synced 2025-03-15 00:03:28 +01:00
vue ui i18n: fixed bug: if multiple embedded named strings in localized string must replace ALL (use global regex flag)
This commit is contained in:
parent
6e7f0216e1
commit
47ada39b16
@ -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
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user