Getting Started with the Kendo UI for Angular Internationalization
This guide provides the information you need to start using the Kendo UI for Angular Internationalization component—it includes instructions about the available installation approaches, the required dependencies, the code for running the project, and links to additional resources.
After the completion of this guide, you will be able to achieve an end result as demonstrated in the following example.
Setting Up Your Angular Project
Before you start with the installation of any Kendo UI for Angular control, ensure that you have a running Angular project. The prerequisites to accomplish the installation of the components are always the same regardless of the Kendo UI for Angular package you want to use, and are fully described in the section on setting up your Angular project.
Installing the Package
-
To add the Kendo UI for Angular Internationalization package, run the following command:
npm install --save @progress/kendo-angular-intl @progress/kendo-licensing
-
Import the
IntlModule
in your root application, feature module, or standalone components.2.1 Using Modules
import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { IntlModule } from '@progress/kendo-angular-intl'; import { AppComponent } from './app.component'; @NgModule({ imports: [BrowserModule, IntlModule], declarations: [AppComponent], bootstrap: [AppComponent] }) export class AppModule {}
2.2 Using Standalone Components
import { Component } from '@angular/core'; import { IntlModule } from '@progress/kendo-angular-intl'; @Component({ standalone: true, selector: 'my-app', imports: [IntlModule], template: ` <p>{{ intl.formatNumber(decimal, 'n2') }}</p> `. })
Using the Package
-
After successfully installing the Internationalization, provide the
IntlService
service in the constructor in theapp.component.ts
file:export class AppComponent { constructor(public intl: IntlService) {} }
-
Then, use the
formatNumber
function of the service to format the number:<p>{{ intl.formatNumber(decimal, 'n2') }}</p>
-
Build and serve the application by running the following command in the root folder.
ng serve
-
Point your browser to http://localhost:4200 to see the formatted number on the page.
Activating Your License Key
As of December 2020, using any of the UI components from the Kendo UI for Angular library requires either a commercial license key or an active trial license key. If your application does not contain a Kendo UI license file, activate your license key.
Next Steps
- Loading default and additional locale data
- Changing the current locale at runtime
- Parsing and formatting of dates and numbers
- Pipes
- Services
- API Reference of the Internationalization
Dependencies
The following table lists the specific functionalities that are provided by each of the Internationalization dependencies as per package:
Package Name | Description |
---|---|
@angular/common | Provides the commonly-needed services, pipes, and directives provided by the Angular team. For more information, refer to the official Angular documentation. |
@angular/core | Contains critical runtime parts of the Angular framework that are needed by every application. For more information, refer to the official Angular documentation. |
@progress/kendo-licensing | Contains the kendo-ui-license CLI Tool for license management and the validatePackage function and type definitions that are used by licensed packages. |
rxjs | Provides the RxJS library for reactive programming which uses Observables for an easier composition of asynchronous or callback-based code. |
The following dependency will be installed automatically.
Package Name | Description |
---|---|
@progress/kendo-intl | Provides the Kendo UI services and pipes for the parsing and formatting of dates and numbers by using Unicode Common Locale Data Repository (CLDR) data. |