Skip to content

Commit babc1fc

Browse files
committed
docs: 修复默认语言异常问题
1 parent 1265331 commit babc1fc

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

docs/rspress.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ export default defineConfig({
7676
'@': path.resolve(__dirname, './src'),
7777
},
7878
define: {
79+
'process.env.DEFAULT_LANG': JSON.stringify(process.env.IS_SODOC ? 'zh-cn' : 'en'),
7980
'process.env.ASSETS_PREFIX': JSON.stringify(assetsPrefix),
8081
'process.env.REACT_USE_VERSION': JSON.stringify(version),
8182
},

docs/src/utils/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export * from '@formkit/auto-animate/react'
66
export * from './hooks'
77

88
export const repoBase = 'https://github.com/sheinsight/react-use/blob/main/packages/react-use/src'
9-
export const defaultLang = 'en'
9+
export const defaultLang = process.env.DEFAULT_LANG || 'en'
1010

1111
export const OTP = (): string => Math.random().toString(16).slice(-6).toUpperCase()
1212
export const wait = (ms = 300, res: string = OTP()): Promise<string> =>

0 commit comments

Comments
 (0)