mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-22 20:37:48 +00:00
16 lines
562 B
TypeScript
16 lines
562 B
TypeScript
import { I18nNsType } from '../../types/i18next';
|
|
import { serverSideTranslations } from 'next-i18next/serverSideTranslations';
|
|
|
|
export const serviceSideProps = async (content: any, ns: I18nNsType = []) => {
|
|
const lang = content.req?.cookies?.NEXT_LOCALE || content.locale;
|
|
const extraLng = content.req?.cookies?.NEXT_LOCALE ? undefined : content.locales;
|
|
|
|
// Device size
|
|
const deviceSize = content.req?.cookies?.NEXT_DEVICE_SIZE || null;
|
|
|
|
return {
|
|
...(await serverSideTranslations(lang, ['common', ...ns], null, extraLng)),
|
|
deviceSize
|
|
};
|
|
};
|