最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to change ANTD table text to different language - Stack Overflow

programmeradmin3浏览0评论

I want the ant design (React) pagination to be in my language (spanish). The ideal thing would be to render "por página" instead of "page" in the next picture:

(code)

 pagination={{ defaultPageSize: 3, showSizeChanger: true, pageSizeOptions: ['5','10', '20', '30']}}

(picture)

Thanks!

I want the ant design (React) pagination to be in my language (spanish). The ideal thing would be to render "por página" instead of "page" in the next picture:

(code)

 pagination={{ defaultPageSize: 3, showSizeChanger: true, pageSizeOptions: ['5','10', '20', '30']}}

(picture)

Thanks!

Share Improve this question edited Mar 22, 2020 at 15:53 keikai 15.2k10 gold badges55 silver badges72 bronze badges asked Mar 22, 2020 at 15:02 Sven BrodersenSven Brodersen 871 silver badge7 bronze badges 1
  • mmmm not exactly, my goal is to personalize the text, but thanks man – Sven Brodersen Commented Mar 22, 2020 at 15:15
Add a ment  | 

1 Answer 1

Reset to default 5

Explanation

This is often so called i18n or internationalization

And Ant does have an Internationalization solution provided.

Refer to document ant i18n, you can find the language list there.


Demo

  • for example: In spanish


Usage

import { ConfigProvider } from 'antd';
import es_ES from 'antd/es/locale/es_ES';

return (
  <ConfigProvider locale={es_ES}>
    <App />
  </ConfigProvider>
);

Try it online:

发布评论

评论列表(0)

  1. 暂无评论