Fixed JavaScript and CSS evaluation on instant loading

This commit is contained in:
squidfunk
2020-03-09 16:46:22 +01:00
parent 6daac21f65
commit ea29135841
3 changed files with 6 additions and 5 deletions

View File

@@ -64,7 +64,7 @@ let lang: Record<string, string>
export function translate(key: TranslateKey, value?: string): string {
if (typeof lang === "undefined") {
const el = getElementOrThrow("#__lang")
lang = JSON.parse(el.innerText)
lang = JSON.parse(el.textContent!)
}
if (typeof lang[key] === "undefined") {
throw new ReferenceError(`Invalid translation: ${key}`)