Localization
To localize the classic Bold Reports® Angular Report Designer, import the culture script files for your culture and set the culture name to the locale property. Localization is the process of customizing the application for a given culture and locale, which involves much more than the simple translation of text. In the classic Report Designer, localized strings appropriate to each culture are stored in separate files and loaded according to the UI culture setting.
Use these steps to localize the Bold Reports® Designer version less than
v5.2.xx.
By default, the classic Report Designer displays 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 following command to install the
@boldreports/globalpackage.npm install @boldreports/global --save -
Refer to the
ej.localetexts.fr-FR.min.jsandej.culture.fr-FR.min.jsfiles fromnode_modulesin theapp.module.tsfile.import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; import { BoldReportsModule } from '@boldreports/angular-reporting-components'; import '@boldreports/javascript-reporting-controls/Scripts/bold.report-viewer.min'; import '@boldreports/javascript-reporting-controls/Scripts/bold.report-designer.min'; import '@boldreports/global/l10n/reportdesigner/ej.localetexts.fr-FR.min.js'; import '@boldreports/global/i18n/ej.culture.fr-FR.min.js'; import { AppRoutingModule } from './app-routing.module'; import { AppComponent } from './app.component'; @NgModule({ declarations: [ AppComponent ], imports: [ BrowserModule, BoldReportsModule, AppRoutingModule ], providers: [], bootstrap: [AppComponent] }) export class AppModule { }If you import the culture before the
@boldreports/angular-reporting-componentspackage, you get the following error in your application. Import the culture after the@boldreports/angular-reporting-componentspackage.
-
Open the
src/app/app.component.tsand initialize thelocalefor 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://demos.boldreports.com/services/api/ReportingAPI"; this.locale = "fr-FR"; } } -
Open the
src/app/app.component.htmlfile and assign thelocalefor Report Designer.<bold-reportdesigner id="designer" style="position: absolute;height: 550px; width: 1250px;" [serviceUrl] = "serviceUrl" [locale]= "locale"></bold-reportdesigner>