mirror of
https://github.com/ManInDark/HabitTrove.git
synced 2026-01-20 22:24:28 +01:00
Added i18n support (#129)
This commit is contained in:
13
i18n/request.ts
Normal file
13
i18n/request.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { getRequestConfig } from 'next-intl/server';
|
||||
import { loadSettings } from '@/app/actions/data'; // Adjust path as necessary
|
||||
|
||||
export default getRequestConfig(async () => {
|
||||
// Load settings to get the user's preferred language
|
||||
const settings = await loadSettings();
|
||||
const locale = settings.system.language || 'en'; // Fallback to 'en' if not set
|
||||
|
||||
return {
|
||||
locale,
|
||||
messages: (await import(`../messages/${locale}.json`)).default
|
||||
};
|
||||
});
|
||||
Reference in New Issue
Block a user