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

🐛 [BUG] 多语言,默认指定英文 en-us ,项目启动后还是中文 #11317

Closed
mmzzli opened this issue Aug 21, 2024 · 2 comments
Closed

Comments

@mmzzli
Copy link

mmzzli commented Aug 21, 2024

🐛 bug 描述

多语言,默认指定英文 en-us ,项目启动后还是中文,localstorage 中的 key 已经删除,默认还是中文。

📷 复现步骤 | Recurrence steps

通过 pro create xxx 创建的项目,把 config.ts 中的 Locale 的 default 修改为 en-US.

telegram-cloud-photo-size-1-5055726444050754967-y

🏞 期望结果 | Expected results

期望默认是英文,打开就是英文

期望默认是英文
image

💻 复现代码 | Recurrence code

https://github.com/mmzzli/test-umi-pro

© 版本信息

  • Ant Design Pro 版本: [e.g. 4.0.0] 4
    "@ant-design/pro-components": "^2.6.48",
    "@umijs/route-utils": "^2.2.2",
    "antd": "^5.13.2",
  • umi 版本
    "@umijs/max": "^4.1.1",
  • 浏览器环境
    image
  • 开发环境 [e.g. mac OS]
    image

🚑 其他信息

@nathanlao
Copy link

Could try using ConfigProvider in antd to provide Internationalization configuration to your React components, exmaple usage:

import { ConfigProvider, enUSIntl } from '@ant-design/pro-table';

<ConfigProvider value={{ intl: enUSIntl }}>
	<YourReactComponent>
</ConfigProvider>

@xyovo
Copy link

xyovo commented Sep 19, 2024

我觉得应该是因为你浏览器是中文语言,你可以试试把baseNavigator配置改为false,这样default应该会生效
https://umijs.org/docs/max/i18n#%E9%85%8D%E7%BD%AE%E6%8F%92%E4%BB%B6
image

@mmzzli mmzzli closed this as completed Sep 19, 2024
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

3 participants