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 set the locale and text direction of an Arc, Linear, and Radial Gauge.

import * as React from 'react';
import * as ReactDOM from 'react-dom';
import {
    ArcGauge,
    LinearGauge,
    RadialGauge
} from '@progress/kendo-react-gauges';

import { DropDownList } from '@progress/kendo-react-dropdowns';

import { IntlProvider } from '@progress/kendo-react-intl';
import { loadCldr } from './cldr.js';

loadCldr();

class GaugeContainer extends React.Component {
    state = {
        locale: 'bg-BG'
    };

    onChange = ( event ) => {
        this.setState({ locale: event.target.value });
    }

    render() {
        const { locale } = this.state;

        const value = 30;

        return (
            <div>
                 <div className="example-config">
                    <label>
                        Current locale
                    </label>
                    <DropDownList
                        style={{ marginLeft: 5 }}
                        value={locale}
                        onChange={this.onChange}
                        data={[ 'bg-BG', 'en-US' ]}
                    />
                 </div>
                <IntlProvider locale={locale}>
                    <div className="row">
                        <div className="col-sm-12 col-md-2">
                            <LinearGauge pointer={{ value }} scale={{ labels: { format: 'c' } }} />
                        </div>
                        <div className="col-sm-12 col-md-5">
                            <RadialGauge pointer={{ value }} scale={{ labels: { format: 'c' } }} />
                        </div>
                        <div className="col-sm-12 col-md-5">
                            <ArcGauge
                                value={ value }
                                scale={{
                                    labels: { format: 'c', visible: true },
                                    majorTicks: { visible: true },
                                    minorTicks: { visible: true }
                                }}
                            />
                        </div>
                    </div>
                </IntlProvider>
            </div >
        );
    }
}

ReactDOM.render(
    <GaugeContainer />,
    document.querySelector('my-app')
);
import { load } from '@progress/kendo-react-intl';

import likelySubtags from 'cldr-core/supplemental/likelySubtags.json';
import currencyData from 'cldr-core/supplemental/currencyData.json';
import weekData from 'cldr-core/supplemental/weekData.json';

import bgNumbers from 'cldr-numbers-full/main/bg/numbers.json';
import bgCurrencies from 'cldr-numbers-full/main/bg/currencies.json';
import bgCaGregorian from 'cldr-dates-full/main/bg/ca-gregorian.json';
import bgDataFields from 'cldr-dates-full/main/bg/dateFields.json';
import bgTimeZoneNames from 'cldr-dates-full/main/bg/timeZoneNames.json';

function loadCldr() {
    load(
        likelySubtags,
        currencyData,
        weekData,
        bgNumbers,
        bgCurrencies,
        bgCaGregorian,
        bgDataFields,
        bgTimeZoneNames
    );
}

export { loadCldr };

Internationalization

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

For more information, refer to:

Messages

The Gauges do not provide built-in translated messages or the option to implement and localize custom ones.

Right-to-Left Support

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

import * as React from 'react';
import * as ReactDOM from 'react-dom';
import {
    LinearGauge
} from '@progress/kendo-react-gauges';


const ArcContainer = () => (
    <div style={{ direction: 'rtl' }}>
        <LinearGauge pointer={{ value: 30 }} scale={{ vertical: false, labels: { format: 'c' } }} />
    </div >
);

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

In this article