mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 13:03:50 +00:00
4.8.16 test (#3442)
* perf: simple app save * fix: notify config i18n * perf: service side props render * perf: model selector * update doc
This commit is contained in:
15
packages/web/common/system/nextjs.ts
Normal file
15
packages/web/common/system/nextjs.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
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 || 'pc';
|
||||
|
||||
return {
|
||||
...(await serverSideTranslations(lang, ['common', ...ns], null, extraLng)),
|
||||
deviceSize
|
||||
};
|
||||
};
|
Reference in New Issue
Block a user