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:
Archer
2024-12-20 18:58:40 +08:00
committed by GitHub
parent 922cb433d3
commit e6d53e3daa
77 changed files with 878 additions and 326 deletions

View 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
};
};