如何在 Ant Design Pro 中更改便携式过滤器上的按钮文本语言
我在 ant design 中有一个专业表,其中我 想要应用过滤。然而,过滤器上的操作按钮始终是中文的,如附图所示。我想把它们改成英文。我真的很感激任何帮助。
这是我的代码片段:
const columns:ProColumns<GithubIssueItem>[]=[
{
dataIndex: 'condition',
title: 'Condition',
ellipsis: true,
// valueType: "select",
filters: true,
onFilter: true,
valueEnum: {
all: { text: "Okay", status: "Default" },
open: {
text: "unresolved",
status: "Error",
},
closed: {
text: "resolved",
status: "Success",
disabled: true,
},
processing: {
text: "solving",
status: "Processing",
},
},
},
...
]
I have a pro-table in ant design in which Iwant to apply filtering. However, the action buttons on the filters are always in Chinese as shown in the attached image. I want to change them to English. I would really appreciate any help.
Here is my code snippet:
const columns:ProColumns<GithubIssueItem>[]=[
{
dataIndex: 'condition',
title: 'Condition',
ellipsis: true,
// valueType: "select",
filters: true,
onFilter: true,
valueEnum: {
all: { text: "Okay", status: "Default" },
open: {
text: "unresolved",
status: "Error",
},
closed: {
text: "resolved",
status: "Success",
disabled: true,
},
processing: {
text: "solving",
status: "Processing",
},
},
},
...
]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
替代解决方案(其他解决方案对我不起作用):
它可以在主文件(例如 app.js)中声明,它将更改所有专业组件的语言。 在这里找到。
Alternative solution (other solutions didn't work for me):
It can be declared in the main file (app.js for example) and it will change the language of all the pro components. Found here.
我刚刚找到了 ant design pro 的 ProTable locale 的解决方案。
在您的 App.js 中:
Ant Pro 的配置提供程序将自动更改您使用 Ant 的每个组件中的中文设计专业人士。
I just found a solution for ProTable locale of ant design pro.
In your App.js:
The config provider of Ant Pro will auto change the Chinese language in every component you use of Ant Design Pro.
您需要从 antd 导入 ConfigProvider 和语言环境
You need to import the ConfigProvider and the locale from antd