Fix build

This commit is contained in:
Pieter Vander Vennet 2023-12-12 19:26:15 +01:00
parent 8a7d8a43ce
commit de9dca54bd

View file

@ -2,6 +2,7 @@ import { UIEventSource } from "../../Logic/UIEventSource"
import { LocalStorageSource } from "../../Logic/Web/LocalStorageSource" import { LocalStorageSource } from "../../Logic/Web/LocalStorageSource"
import { Utils } from "../../Utils" import { Utils } from "../../Utils"
import { QueryParameters } from "../../Logic/Web/QueryParameters" import { QueryParameters } from "../../Logic/Web/QueryParameters"
import Doc = Mocha.reporters.Doc
export default class Locale { export default class Locale {
public static showLinkToWeblate: UIEventSource<boolean> = new UIEventSource<boolean>(false) public static showLinkToWeblate: UIEventSource<boolean> = new UIEventSource<boolean>(false)
@ -63,9 +64,11 @@ export default class Locale {
source = LocalStorageSource.Get("language", browserLanguage) source = LocalStorageSource.Get("language", browserLanguage)
} }
source.addCallbackAndRun((l) => { if (!Utils.runningFromConsole && typeof document !== undefined) {
document.documentElement.setAttribute("lang", l) source.addCallbackAndRun((l) => {
}) document.documentElement.setAttribute("lang", l)
})
}
if (!Utils.runningFromConsole) { if (!Utils.runningFromConsole) {
// @ts-ignore // @ts-ignore