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 show the value as a culture-specific currency in the available Inputs components and how to localize their built-in messages.

import React from 'react';
import ReactDOM from 'react-dom';

import { IntlProvider , load, loadMessages, LocalizationProvider } from '@progress/kendo-react-intl';
import { NumericTextBox } from '@progress/kendo-react-inputs';

import likelySubtags from 'cldr-core/supplemental/likelySubtags.json';
import currencyData from 'cldr-core/supplemental/currencyData.json';
import esNumbers from 'cldr-numbers-full/main/es/numbers.json';
import esCurrencies from 'cldr-numbers-full/main/es/currencies.json';

load(likelySubtags , currencyData, esNumbers, esCurrencies);

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

class App extends React.Component {
    render() {
        return (
            <div className="example-wrapper row">
                <div class="col-xs-12 col-sm-6 example-col">
                    <LocalizationProvider language="es">
                        <IntlProvider locale="en">
                            <NumericTextBox
                                defaultValue={123.45}
                                format="c2"
                            />
                        </IntlProvider>
                    </LocalizationProvider>
                </div>
                <div class="col-xs-12 col-sm-6 example-col">
                    <LocalizationProvider language="es">
                        <IntlProvider locale="es">
                            <NumericTextBox
                                defaultValue={123.45}
                                format="c2"
                            />
                        </IntlProvider>
                    </LocalizationProvider>
                </div>
            </div>
        );
    }
}
ReactDOM.render(
    <App />,
    document.querySelector('my-app')
);
{
    "numerictextbox": {
        "increment": "Incrementar valor",
        "decrement": "Disminuir valor"
    }
}

Internationalization

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

For more information, refer to:

Messages

The Inputs support the localization of their messages by utilizing the KendoReact Internationalization package.

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

Message Key Default Value
numerictextbox.increment Increase value
numerictextbox.decrement Decrease value

Right-to-Left Support

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

class App extends React.Component {
    value = 123.45;
    render() {
        return (
             <div className="row example-wrapper" styles={{ minHeight: 450 }}>
                <div className="col-xs-12 col-md-6 example-col">
                    <p>NumericTextBox</p>
                    <NumericTextBox
                        dir="rtl"
                        defaultValue={this.value}
                        format="c2"
                    />
                </div>
                <div className="col-xs-12 col-md-6 example-col">
                    <p>Switch</p>
                    <Switch
                        dir="rtl"
                    />
                </div>
            </div>
        );
    }
}
ReactDOM.render(
    <App />,
    document.querySelector('my-app')
);

In this article