// @ts-ignore import translations from "../translations/index.mjs"; // ts-unignore import { Form } from "../elements/Form"; import { Margin } from "../elements/Margin"; import { MarginInline } from "../elements/MarginInline"; import { Page } from "../types/Page"; import { reloadNavBar } from "../elements/NavBar"; import { render } from "preact"; import i18next from "i18next"; const languageIDs = Object.getOwnPropertyNames(translations); export class SetLanguagePage extends Page { constructor() { super(); } async render(): Promise { render(
this.onSubmit(data)}>

, this.router.pageContentElement, ); } async onSubmit(data: FormData): Promise { const language = data.get("language") as string; this.state.language = language; const t = await i18next.changeLanguage(language); this.state.pageDirection = t("language_direction"); reloadNavBar(this.router); await this.router.changePage("HOME"); } get name(): string { return i18next.t("set_language_title"); } }