Globalization

The globalization process combines the translation of component messages with adapting them to specific locales.

For more information on how globalization practices are implemented in KendoReact, refer to the overview article. For more information on the globalization aspects which are available for each component, refer to the article on globalization support.

The following example demonstrates how to localize the built-in messages of the KendoReact Pager.

import React from 'react';
import ReactDOM from 'react-dom';
import { Pager } from '@progress/kendo-react-data-tools';
import { loadMessages, LocalizationProvider } from '@progress/kendo-react-intl';

import esMessages from './es.json';
loadMessages(esMessages, 'es');

import { products } from './products.js';

class App extends React.Component {
    total = products.length;
    state = { skip: 0, take: 5 };

    render() {
        return (
            <LocalizationProvider language="es">
                <Pager
                    skip={this.state.skip}
                    take={this.state.take}
                    total={this.total}
                    buttonCount={5}
                    info={true}
                    type="numeric"
                    pageSizes={[5, 10, 20]}
                    previousNext={true}
                    onPageChange={this.handlePageChange}
                />
            </LocalizationProvider>
        );
    }

    handlePageChange = event => {
        const { skip, take } = event;
        this.setState({ skip, take });

        console.log(`Page Change: skip ${skip}, take ${take}`);
        console.log('Current Products: ', products.slice(skip, skip + take));
    };
}

ReactDOM.render(
    <App />,
    document.querySelector('my-app')
);

Internationalization

The internationalization process applies specific culture formats to a web application.

For more information, refer to:

Messages

The Pager supports the localization of its messages by utilizing the KendoReact Internationalization package.

The following table lists the built-in message keys and their default values.

Message KeyDefault Value
pager.itemsPerPageitems per page
pager.info{0} - {1} of {2} items
pager.firstPageGo to the first page
pager.previousPageGo to the previous page
pager.nextPageGo to the next page
pager.lastPageGo to the last page
pager.pagePage
pager.ofof

Right-to-Left Support

The following example demonstrates how to utilize the RTL support for the Pager.

import React from 'react';
import ReactDOM from 'react-dom';
import { Pager } from '@progress/kendo-react-data-tools';

class App extends React.Component {
    state = { skip: 0, take: 5 };

    render() {
        return (
            <Pager
                style={{ direction: 'rtl' }}
                skip={this.state.skip}
                take={this.state.take}
                total={200}
                onPageChange={this.handlePageChange}
                buttonCount={5}
                info={true}
                previousNext={true}
                type="numeric"
                pageSizes={[5, 10, 20]}
            />
        );
    }

    handlePageChange = event => {
        this.setState({ skip: event.skip, take: event.take });
    };
}

ReactDOM.render(
    <App />,
    document.querySelector('my-app')
);
 /