# Services

The Internationalization package exposes [`IntlService`](https://www.telerik.com/kendo-react-ui/components/intl/api/intlservice) service for default and customized internationalization of locales and [`LocalizationService`](https://www.telerik.com/kendo-react-ui/components/intl/api/localizationservice) for providing messages based on the current language.

## Using the `IntlService` in Components

To use the service in your own components:

1. Use the `IntlProvider` component in your parent component.
2. If you require locale data that is different from the default `en-US` locale data, [load the data you need](https://www.telerik.com/kendo-react-ui/components/intl/i18n/loading-data) in your parent component.
3. Access the `IntlService`:
   * In Functional Components—Through the [`useInternationalization`](https://www.telerik.com/kendo-react-ui/components/intl/api/useinternationalization) hook.
   * In Class Components —Register your child component for internationalization by using the [`registerForIntl`](https://www.telerik.com/kendo-react-ui/components/intl/api/registerforintl) function and consume it through the [`provideIntlService`](https://www.telerik.com/kendo-react-ui/components/intl/api/provideintlservice) function.

[Demo Source](https://demos.telerik.com/kendo-react-ui/intl/load-prebuild-data/func/source.txt)

## Applying the `LocalizationService` in Components

The [`toLanguageString`](https://www.telerik.com/kendo-react-ui/components/intl/api/localizationservice#tolanguagestring) method of the `LocalizationService` accepts a key and a default value. To use the `LocalizationService` in your own components in conjunction with the `LocalizationProvider`:

1. Use the `LocalizationProvider` component in your parent component.
2. Set the [`language`](https://www.telerik.com/kendo-react-ui/components/intl/api/localizationproviderprops#language) property.
3. Access the `LocalizationService`:
   * In Functional Components—Through the [`useLocalization`](https://www.telerik.com/kendo-react-ui/components/intl/api/uselocalization) hook.
   * In Class Components —Register your child component for internationalization by using the [`registerForLocalization`](https://www.telerik.com/kendo-react-ui/components/intl/api/registerforlocalization) function and consume it through the [`provideLocalizationService`](https://www.telerik.com/kendo-react-ui/components/intl/api/providelocalizationservice) function.

[Demo Source](https://demos.telerik.com/kendo-react-ui/intl/localization/overview/func/source.txt)

## Customizing the Default Service

To override the default behavior of the internationalization service:

1. Create a custom function that internally uses the `IntlService` and overrides only the methods you need, such as `formatDate`.
2. Create a context and a provider component `CustomIntlProvider` that calls the custom function and shares the resulting service instance with its children.
3. Define a `useCustomIntl` hook that reads the current service from context.

[Demo Source](https://demos.telerik.com/kendo-react-ui/intl/custom-service/func/source.txt)

## Suggested Links

* [IntlService API Reference](https://www.telerik.com/kendo-react-ui/components/intl/api/intlservice)
* [LocalizationService API Reference](https://www.telerik.com/kendo-react-ui/components/intl/api/localizationservice)
* [Troubleshooting](https://www.telerik.com/kendo-react-ui/components/intl/i18n/troubleshooting)
