Localizing the Viewer
Our sample projects and report templates can help you learn the basics of working with our products.The viewer interface can be localized by loading a Stimulsoft language XML file before it renders.
In Angular.
How it works. The viewer reads its captions from the loaded file, so switching language is a single call.
In Angular.
import { Component } from "@angular/core";
import { Viewer, Stimulsoft } from "stimulsoft-dashboards-js-angular/viewer";
@Component({
imports: [Viewer],
template: `<sti-viewer [report]="report" [options]="options"></sti-viewer>`
})
export class Example {
report: Stimulsoft.Report.StiReport;
options: Stimulsoft.Viewer.StiViewerOptions;
constructor() {
this.report = new Stimulsoft.Report.StiReport();
this.report.loadFile("Dashboards/Dashboard.mrt");
Stimulsoft.Base.Localization.StiLocalization.setLocalizationFile("Localizations/pt.xml");
this.options = new Stimulsoft.Viewer.StiViewerOptions();
this.options.appearance.fullScreenMode = true;
}
}StiLocalization.setLocalizationFile(path)— load the UI language file (e.g. Portuguese); the viewer captions switch to it.
How it works. The viewer reads its captions from the loaded file, so switching language is a single call.