Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

为什么线上版本的是默认英文,请问有没有修改默认语言的配置呢 #19

Open
LRboyz opened this issue Jul 25, 2023 · 1 comment

Comments

@LRboyz
Copy link

LRboyz commented Jul 25, 2023

🔥我克隆了此项目并在本地运行,但是在本地环境他默认的是zh-CN,我注意到I18n.ts这个文件的配置有一个isDefault的配置,我把他加到en但好像没有效果,默认还是会跳到zh-CN这个路径,并且有个很奇怪的现象(就是我点击了左侧的Sidebar之后再点击切换语言,会出现路径是localhost://3333/zh-CN/en/about)这种现象,我找不到问题在哪里,可以解答一下吗😭

@CaliCastle
Copy link
Member

Hi,主要控制路由级别的「默认语言」是由 middleware.ts 里控制的,同时也可以看看 app/LocaleSelector.tsx 的切换语言组件实现。

i18n.ts 主要是给 sanity 用来告知哪个是 default document locale 的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants