mirror of https://github.com/langgenius/dify.git
chore: temp
This commit is contained in:
parent
5ec7920c42
commit
25aaf53375
|
|
@ -3,7 +3,7 @@ import { getLocaleOnServer, useTranslation as translate } from '@/i18n/server'
|
|||
import Form from '@/app/components/datasets/settings/form'
|
||||
|
||||
const Settings = async () => {
|
||||
const locale = getLocaleOnServer()
|
||||
const locale = await getLocaleOnServer()
|
||||
const { t } = await translate(locale, 'dataset-settings')
|
||||
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -7,10 +7,10 @@ export type II18NServerProps = {
|
|||
children: React.ReactNode
|
||||
}
|
||||
|
||||
const I18NServer = ({
|
||||
const I18NServer = async ({
|
||||
children,
|
||||
}: II18NServerProps) => {
|
||||
const locale = getLocaleOnServer()
|
||||
const locale = await getLocaleOnServer()
|
||||
|
||||
return (
|
||||
<I18N {...{ locale }}>
|
||||
|
|
|
|||
|
|
@ -19,12 +19,12 @@ export const viewport: Viewport = {
|
|||
userScalable: false,
|
||||
}
|
||||
|
||||
const LocaleLayout = ({
|
||||
const LocaleLayout = async ({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode
|
||||
}) => {
|
||||
const locale = getLocaleOnServer()
|
||||
const locale = await getLocaleOnServer()
|
||||
|
||||
return (
|
||||
<html lang={locale ?? 'en'} className="h-full" data-theme="light">
|
||||
|
|
|
|||
|
|
@ -30,12 +30,13 @@ export async function useTranslation(lng: Locale, ns = '', options: Record<strin
|
|||
}
|
||||
}
|
||||
|
||||
export const getLocaleOnServer = (): Locale => {
|
||||
export const getLocaleOnServer = async (): Promise<Locale> => {
|
||||
const locales: string[] = i18n.locales
|
||||
|
||||
let languages: string[] | undefined
|
||||
// get locale from cookie
|
||||
const localeCookie = cookies().get('locale')
|
||||
const cookieStore = await cookies()
|
||||
const localeCookie = cookieStore.get('locale')
|
||||
languages = localeCookie?.value ? [localeCookie.value] : []
|
||||
|
||||
if (!languages.length) {
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@
|
|||
"@mdx-js/loader": "^2.3.0",
|
||||
"@mdx-js/react": "^2.3.0",
|
||||
"@monaco-editor/react": "^4.6.0",
|
||||
"@next/mdx": "^14.0.4",
|
||||
"@next/mdx": "15.1.5",
|
||||
"@remixicon/react": "^4.5.0",
|
||||
"@sentry/react": "^7.54.0",
|
||||
"@sentry/utils": "^7.54.0",
|
||||
|
|
@ -69,14 +69,14 @@
|
|||
"mermaid": "11.4.1",
|
||||
"mime": "^4.0.4",
|
||||
"negotiator": "^0.6.3",
|
||||
"next": "^14.2.10",
|
||||
"next": "15.1.5",
|
||||
"pinyin-pro": "^3.23.0",
|
||||
"qrcode.react": "^3.1.0",
|
||||
"qs": "^6.11.1",
|
||||
"rc-textarea": "^1.5.2",
|
||||
"react": "~18.2.0",
|
||||
"react": "19.0.0",
|
||||
"react-18-input-autosize": "^3.0.0",
|
||||
"react-dom": "~18.2.0",
|
||||
"react-dom": "19.0.0",
|
||||
"react-easy-crop": "^5.0.8",
|
||||
"react-error-boundary": "^4.0.2",
|
||||
"react-hook-form": "^7.51.4",
|
||||
|
|
@ -118,15 +118,15 @@
|
|||
"@chromatic-com/storybook": "^1.9.0",
|
||||
"@faker-js/faker": "^7.6.0",
|
||||
"@rgrove/parse-xml": "^4.1.0",
|
||||
"@storybook/addon-essentials": "^8.3.5",
|
||||
"@storybook/addon-interactions": "^8.3.5",
|
||||
"@storybook/addon-links": "^8.3.5",
|
||||
"@storybook/addon-onboarding": "^8.3.5",
|
||||
"@storybook/addon-themes": "^8.3.5",
|
||||
"@storybook/blocks": "^8.3.5",
|
||||
"@storybook/nextjs": "^8.3.5",
|
||||
"@storybook/react": "^8.3.5",
|
||||
"@storybook/test": "^8.3.5",
|
||||
"@storybook/addon-essentials": "8.5.0",
|
||||
"@storybook/addon-interactions": "8.5.0",
|
||||
"@storybook/addon-links": "8.5.0",
|
||||
"@storybook/addon-onboarding": "8.5.0",
|
||||
"@storybook/addon-themes": "8.5.0",
|
||||
"@storybook/blocks": "8.5.0",
|
||||
"@storybook/nextjs": "8.5.0",
|
||||
"@storybook/react": "8.5.0",
|
||||
"@storybook/test": "8.5.0",
|
||||
"@testing-library/dom": "^10.3.2",
|
||||
"@testing-library/jest-dom": "^6.4.6",
|
||||
"@testing-library/react": "^16.0.0",
|
||||
|
|
@ -138,8 +138,8 @@
|
|||
"@types/negotiator": "^0.6.1",
|
||||
"@types/node": "18.15.0",
|
||||
"@types/qs": "^6.9.7",
|
||||
"@types/react": "~18.2.0",
|
||||
"@types/react-dom": "~18.2.0",
|
||||
"@types/react": "19.0.7",
|
||||
"@types/react-dom": "19.0.3",
|
||||
"@types/react-slider": "^1.3.1",
|
||||
"@types/react-syntax-highlighter": "^15.5.6",
|
||||
"@types/react-window": "^1.8.5",
|
||||
|
|
@ -152,7 +152,7 @@
|
|||
"code-inspector-plugin": "^0.18.1",
|
||||
"cross-env": "^7.0.3",
|
||||
"eslint": "^8.36.0",
|
||||
"eslint-config-next": "^14.0.4",
|
||||
"eslint-config-next": "15.1.5",
|
||||
"eslint-plugin-storybook": "^0.9.0",
|
||||
"husky": "^8.0.3",
|
||||
"jest": "^29.7.0",
|
||||
|
|
@ -161,7 +161,7 @@
|
|||
"magicast": "^0.3.4",
|
||||
"postcss": "^8.4.31",
|
||||
"sass": "^1.61.0",
|
||||
"storybook": "^8.3.5",
|
||||
"storybook": "8.5.0",
|
||||
"tailwindcss": "^3.4.4",
|
||||
"ts-node": "^10.9.2",
|
||||
"typescript": "4.9.5",
|
||||
|
|
@ -179,5 +179,10 @@
|
|||
"**/*.ts?(x)": [
|
||||
"eslint --fix"
|
||||
]
|
||||
},
|
||||
"overrides": {
|
||||
"@types/react": "19.0.7",
|
||||
"@types/react-dom": "19.0.3",
|
||||
"@storybook/test": "8.5.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue