mirror of
https://github.com/lukevella/rallly.git
synced 2025-07-20 17:57:22 +02:00
♻️ Use languages package in middleware
This commit is contained in:
parent
d477d066a4
commit
467ad4b6bb
1 changed files with 2 additions and 23 deletions
|
@ -1,29 +1,8 @@
|
|||
import languages from "@rallly/languages";
|
||||
import languageParser from "accept-language-parser";
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
|
||||
const supportedLocales = [
|
||||
"ca",
|
||||
"cs",
|
||||
"da",
|
||||
"de",
|
||||
"en",
|
||||
"es",
|
||||
"fi",
|
||||
"fr",
|
||||
"hu",
|
||||
"hr",
|
||||
"it",
|
||||
"ko",
|
||||
"nl",
|
||||
"pl",
|
||||
"pt",
|
||||
"pt-BR",
|
||||
"ru",
|
||||
"sk",
|
||||
"sv",
|
||||
"vi",
|
||||
"zh",
|
||||
];
|
||||
const supportedLocales = Object.keys(languages);
|
||||
|
||||
export async function middleware(req: NextRequest) {
|
||||
const { headers, cookies, nextUrl } = req;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue