mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-12-09 21:39:37 +00:00
Merge branch 'master' into liaocl
This commit is contained in:
commit
2ec52a7a45
119 changed files with 11524 additions and 25894 deletions
|
|
@ -17,6 +17,7 @@ const languageCodeMap = {
|
|||
'nl': { label: 'Nederlands', dateFnsLocale: 'nl' },
|
||||
'no': { label: 'Norsk', dateFnsLocale: 'no' },
|
||||
'pl': { label: 'Polski', dateFnsLocale: 'pl' },
|
||||
'pt-br': { label: 'Português (Brasil)', dateFnsLocale: 'ptBR' },
|
||||
'ru': { label: 'Русский', dateFnsLocale: 'ru' },
|
||||
'sv': { label: 'Svenska', dateFnsLocale: 'sv' },
|
||||
'zh-cn': { label: '简体中文 (Simplified Chinese)', dateFnsLocale: 'zhCN' },
|
||||
|
|
@ -93,7 +94,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…
Add table
Add a link
Reference in a new issue