Removed duplicate strings and added English fallback

This commit is contained in:
Nicholas 2023-11-10 15:50:05 -07:00
parent d3a55c8b1a
commit d72665a648
19 changed files with 106 additions and 2131 deletions

View file

@ -169,11 +169,11 @@ Vue.prototype.$downloadFile = (url, filename = null, openInNewTab = false) => {
})
}
export function supplant(str, subs) {
export function supplant(str, subs, defaultMapping) {
// source: http://crockford.com/javascript/remedial.html
return str.replace(/{([^{}]*)}/g,
function (a, b) {
var r = subs[b]
var r = subs[b] || (defaultMapping && defaultMapping[b]);
return typeof r === 'string' || typeof r === 'number' ? r : a
}
)