Skip to content

Commit

Permalink
fix: Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
dhardtke committed Apr 23, 2021
1 parent 7f11cfc commit 797c83d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/http/middleware/language.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -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();
}

0 comments on commit 797c83d

Please sign in to comment.