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
1 Answer
Reset to default 5Explanation
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: