mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-12 10:36:44 +00:00
seperate file
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import { Lang, LANGS } from "@/i18n/request";
|
||||
import { setLanguageCookie } from "@/lib/cookies";
|
||||
import { Lang, LANGS } from "@/lib/i18n";
|
||||
import {
|
||||
Listbox,
|
||||
ListboxButton,
|
||||
|
||||
@@ -1,33 +1,8 @@
|
||||
import { LANGUAGE_COOKIE_NAME } from "@/lib/i18n";
|
||||
import deepmerge from "deepmerge";
|
||||
import { getRequestConfig } from "next-intl/server";
|
||||
import { cookies } from "next/headers";
|
||||
|
||||
export interface Lang {
|
||||
name: string;
|
||||
code: string;
|
||||
}
|
||||
|
||||
export const LANGS: Lang[] = [
|
||||
{
|
||||
name: "English",
|
||||
code: "en",
|
||||
},
|
||||
{
|
||||
name: "Deutsch",
|
||||
code: "de",
|
||||
},
|
||||
{
|
||||
name: "Italiano",
|
||||
code: "it",
|
||||
},
|
||||
{
|
||||
name: "Español",
|
||||
code: "es",
|
||||
},
|
||||
];
|
||||
|
||||
export const LANGUAGE_COOKIE_NAME = "NEXT_LOCALE";
|
||||
|
||||
export default getRequestConfig(async () => {
|
||||
const fallback = "en";
|
||||
const cookiesList = cookies();
|
||||
|
||||
25
apps/login/src/lib/i18n.ts
Normal file
25
apps/login/src/lib/i18n.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
export interface Lang {
|
||||
name: string;
|
||||
code: string;
|
||||
}
|
||||
|
||||
export const LANGS: Lang[] = [
|
||||
{
|
||||
name: "English",
|
||||
code: "en",
|
||||
},
|
||||
{
|
||||
name: "Deutsch",
|
||||
code: "de",
|
||||
},
|
||||
{
|
||||
name: "Italiano",
|
||||
code: "it",
|
||||
},
|
||||
{
|
||||
name: "Español",
|
||||
code: "es",
|
||||
},
|
||||
];
|
||||
|
||||
export const LANGUAGE_COOKIE_NAME = "NEXT_LOCALE";
|
||||
Reference in New Issue
Block a user