mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-15 13:51:35 +00:00
Removed duplicate strings and added English fallback
This commit is contained in:
parent
d3a55c8b1a
commit
d72665a648
19 changed files with 106 additions and 2131 deletions
|
|
@ -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
|
||||
}
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue