mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-01-22 00:07:52 +01:00
Fix:Initial language code setting eventBus not yet defined
This commit is contained in:
parent
ce528d4012
commit
a13217dddf
@ -84,7 +84,7 @@ async function loadi18n(code) {
|
||||
|
||||
Vue.prototype.$setDateFnsLocale(languageCodeMap[code].dateFnsLocale)
|
||||
|
||||
this.$eventBus.$emit('change-lang', code)
|
||||
this?.$eventBus?.$emit('change-lang', code)
|
||||
return true
|
||||
}
|
||||
|
||||
|
@ -156,14 +156,14 @@ Vue.prototype.$copyToClipboard = (str, ctx) => {
|
||||
}
|
||||
|
||||
function xmlToJson(xml) {
|
||||
const json = {};
|
||||
const json = {}
|
||||
for (const res of xml.matchAll(/(?:<(\w*)(?:\s[^>]*)*>)((?:(?!<\1).)*)(?:<\/\1>)|<(\w*)(?:\s*)*\/>/gm)) {
|
||||
const key = res[1] || res[3];
|
||||
const value = res[2] && xmlToJson(res[2]);
|
||||
json[key] = ((value && Object.keys(value).length) ? value : res[2]) || null;
|
||||
const key = res[1] || res[3]
|
||||
const value = res[2] && xmlToJson(res[2])
|
||||
json[key] = ((value && Object.keys(value).length) ? value : res[2]) || null
|
||||
|
||||
}
|
||||
return json;
|
||||
return json
|
||||
}
|
||||
Vue.prototype.$xmlToJson = xmlToJson
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user