forked from u14app/gemini-next-chat
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: 优化 store 和 i18n 初始化逻辑
- Loading branch information
Showing
28 changed files
with
553 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
{ | ||
"editor.formatOnSave": true, | ||
"css.lint.unknownAtRules": "ignore" | ||
} | ||
"editor.formatOnSave": true, | ||
"css.lint.unknownAtRules": "ignore", | ||
"i18n-ally.localesPaths": ["locales"], | ||
"i18n-ally.keystyle": "nested" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
'use client' | ||
import { useLayoutEffect } from 'react' | ||
import { I18nextProvider } from 'react-i18next' | ||
import { useSettingStore } from '@/store/setting' | ||
import i18n from '@/plugins/i18n' | ||
|
||
function I18Provider({ children }: { children: React.ReactNode }) { | ||
const { lang } = useSettingStore() | ||
|
||
useLayoutEffect(() => { | ||
i18n.changeLanguage(lang) | ||
}, [lang]) | ||
return <I18nextProvider i18n={i18n}>{children}</I18nextProvider> | ||
} | ||
|
||
export default I18Provider |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.