From 797c83d3c5c46ade5a4bd7ba20c009e8ca95e42f Mon Sep 17 00:00:00 2001 From: dhardtke <1360135+dhardtke@users.noreply.github.com> Date: Fri, 23 Apr 2021 20:53:17 +0200 Subject: [PATCH] fix: Fix build --- src/http/middleware/language.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/http/middleware/language.ts b/src/http/middleware/language.ts index ac2f8e7..c77b01b 100644 --- a/src/http/middleware/language.ts +++ b/src/http/middleware/language.ts @@ -1,6 +1,6 @@ import { Oak } from "../../../deps.ts"; import { en } from "../../i18n/en.ts"; -import { LANGUAGES, setLanguage } from "../../i18n/mod.ts"; +import { LanguageId, LANGUAGES, setLanguage } from "../../i18n/mod.ts"; import { AppState } from "../webserver.ts"; const LANGUAGE_COOKIE = "CookGuideLanguage"; @@ -16,7 +16,7 @@ export async function languageMiddleware( } else { requestedLang = ctx.cookies.get(LANGUAGE_COOKIE); } - const language = LANGUAGES[requestedLang || "en"] || en; + const language = LANGUAGES[requestedLang as LanguageId || "en"] || en; setLanguage(language); await next(); }