Search results

Localization

Localization is the process of customizing the application for a given culture and locale - involving much more than the simple translation of text. In web report designer, localized strings appropriate to each culture are stored in separate files and loaded according to the UI culture setting.

By default report designer display strings in US English(en-US).

To render the static text with specific culture, refer the following corresponding culture script files and set culture name to the locale property of the Report Designer.

* ej.localetexts.fr-FR.min.js
* ej.culture.fr-FR.min.js
  • Run the below command, to install the @syncfusion/reporting-global package

    npm install @syncfusion/reporting-global --save
  • Refer the ej.localetexts.fr-FR.min.js and ej.culture.fr-FR.min.js from node_modules in app.module.ts file .

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { EJ_REPORTDESIGNER_COMPONENTS } from '@syncfusion/reporting-angular/src/ej/reportdesigner.component';
import '@syncfusion/reporting-global/l10n/reportdesigner/ej.localetexts.fr-FR.min.js';
import '@syncfusion/reporting-global/i18n/ej.culture.fr-FR.min.js';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';

@NgModule({
  declarations: [
    AppComponent,
    EJ_REPORTDESIGNER_COMPONENTS
  ],
  imports: [
    BrowserModule,
    AppRoutingModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

If we import the culture before the @syncfusion/reporting-angular package, we get the following error in our application. So, we should import the culture after the @syncfusion/reporting-angular package.

Angular culture error

  • Open the src/app/app.component.ts and initialize the locale for Report Designer.
import { Component } from '@angular/core';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {
    public serviceUrl: string;
    public locale: string;

    constructor() {
        this.serviceUrl = "https://reports.syncfusion.com/demos/services/api/ReportingAPI";
        this.locale = "fr-FR";
    }
}
  • Open the src/app/app.component.html file and assign the locale for Report Designer.
<ej-reportdesigner id="designer" [serviceUrl] = "serviceUrl" [locale]= "locale"></ej-reportdesigner>