6c93b1d995
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
17 lines
468 B
TypeScript
17 lines
468 B
TypeScript
import {getRequestConfig} from 'next-intl/server';
|
|
import {hasLocale} from 'next-intl';
|
|
import {routing} from './routing';
|
|
import {getDictionary} from '../lib/dictionary';
|
|
|
|
export default getRequestConfig(async ({requestLocale}) => {
|
|
const requestedLocale = await requestLocale;
|
|
const locale = hasLocale(routing.locales, requestedLocale)
|
|
? requestedLocale
|
|
: routing.defaultLocale;
|
|
|
|
return {
|
|
locale,
|
|
messages: await getDictionary(locale)
|
|
};
|
|
});
|