mirror of
https://github.com/lukevella/rallly.git
synced 2025-07-21 02:07:23 +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 languageParser from "accept-language-parser";
|
||||||
import { NextRequest, NextResponse } from "next/server";
|
import { NextRequest, NextResponse } from "next/server";
|
||||||
|
|
||||||
const supportedLocales = [
|
const supportedLocales = Object.keys(languages);
|
||||||
"ca",
|
|
||||||
"cs",
|
|
||||||
"da",
|
|
||||||
"de",
|
|
||||||
"en",
|
|
||||||
"es",
|
|
||||||
"fi",
|
|
||||||
"fr",
|
|
||||||
"hu",
|
|
||||||
"hr",
|
|
||||||
"it",
|
|
||||||
"ko",
|
|
||||||
"nl",
|
|
||||||
"pl",
|
|
||||||
"pt",
|
|
||||||
"pt-BR",
|
|
||||||
"ru",
|
|
||||||
"sk",
|
|
||||||
"sv",
|
|
||||||
"vi",
|
|
||||||
"zh",
|
|
||||||
];
|
|
||||||
|
|
||||||
export async function middleware(req: NextRequest) {
|
export async function middleware(req: NextRequest) {
|
||||||
const { headers, cookies, nextUrl } = req;
|
const { headers, cookies, nextUrl } = req;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue