Language selection

This commit is contained in:
headlessdev
2025-04-29 20:14:44 +02:00
parent 5adb7b3967
commit 502f749151
5 changed files with 75 additions and 8 deletions

View File

@@ -11,6 +11,7 @@
"noData": "Keine Daten",
"Loading": "Lade...",
"Refresh": "Aktualisieren",
"Save": "Speichern",
"Server": {
"CPU": "CPU",
"GPU": "GPU",
@@ -330,6 +331,12 @@
"Dark": "Dunkel",
"System": "System"
},
"LanguageSettings": {
"Title": "Spracheinstellungen",
"Description": "Wählen Sie eine Sprache für die Anwendung.",
"English": "Englisch",
"German": "Deutsch"
},
"Notifications": {
"Title": "Benachrichtigungen",
"Description": "Erhalten Sie Warnungen bei Statusänderungen",

View File

@@ -11,6 +11,7 @@
"noData": "No data",
"Loading": "Loading...",
"Refresh": "Refresh",
"Save": "Save",
"Server": {
"CPU": "CPU",
"GPU": "GPU",
@@ -330,6 +331,12 @@
"Dark": "Dark",
"System": "System"
},
"LanguageSettings": {
"Title": "Language Settings",
"Description": "Select a language for the application.",
"English": "English",
"German": "German"
},
"Notifications": {
"Title": "Notifications",
"Description": "Set up notifications to get instantly alerted when an application changes status.",

View File

@@ -1,9 +1,9 @@
import {getRequestConfig} from 'next-intl/server';
import {cookies} from 'next/headers';
export default getRequestConfig(async () => {
// Provide a static locale, fetch a user setting,
// read from `cookies()`, `headers()`, etc.
const locale = 'en';
const cookieStore = await cookies();
const locale = cookieStore.get('language')?.value || 'en';
return {
locale,