Add first i18n stuff

This commit is contained in:
Lokowitz
2025-05-04 15:11:42 +00:00
parent 21f1326045
commit 7eb08474ff
35 changed files with 2629 additions and 759 deletions

4
src/i18n/config.ts Normal file
View File

@@ -0,0 +1,4 @@
export type Locale = (typeof locales)[number];
export const locales = ['en-US', 'de-DE'] as const;
export const defaultLocale: Locale = 'en-US';

11
src/i18n/request.ts Normal file
View File

@@ -0,0 +1,11 @@
import {getRequestConfig} from 'next-intl/server';
import {getUserLocale} from '../services/locale';
export default getRequestConfig(async () => {
const locale = await getUserLocale();
return {
locale,
messages: (await import(`../../messages/${locale}.json`)).default
};
});