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.
Follow this steps to localize Bold Reports® Designer version higher than
v5.2.xx
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
-
Install
BoldReports.GlobalNuget package in your MVC application. -
Refer to the
ej.localetexts.fr-FR.min.jsscript file from theScriptsfolder of your application.<script src="Scripts/bold-reports/v2.0/localization/l10n/ej.localetexts.fr-FR.min.js"></script> <script src="Scripts/bold-reports/v2.0/localization/reportdesigner/ej.localetexts.fr-FR.min.js"></script> <script src="Scripts/bold-reports/v2.0/localization/reportviewer/ej.localetexts.fr-FR.min.js"></script> -
To render the localization Report Designer, use the following code snippet.
-
The following code example illustrates how to set the
localeproperty for Report Designer in theIndex.cshtmlpage.@using BoldReports.Mvc @{ ViewBag.Title = "Index"; } <div style="height:600px"> @(Html.Bold().ReportDesigner("designer").ServiceUrl("https://demos.boldreports.com/services/api/ReportingAPI").Locale("fr-FR")) </div> -
The following code example illustrates how to add Report Designer localization scripts in the layout page.
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>@ViewBag.Title - My ASP.NET Application</title> @Styles.Render("~/Content/css") @Styles.Render("~/Content/bold-reports/v2.0/tailwind-light/bold.report-designer.min.css") @Styles.Render("~/Scripts/CodeMirror/lib/codemirror.css") @Styles.Render("~/Scripts/CodeMirror/addon/hint/show-hint.css") @Scripts.Render("~/bundles/modernizr") </head> <body style="height:100%;width:100%;padding:0;"> @Scripts.Render("~/bundles/jquery") @Scripts.Render("~/bundles/bootstrap") @Scripts.Render("~/Scripts/CodeMirror/lib/codemirror.js") @Scripts.Render("~/Scripts/CodeMirror/addon/hint/show-hint.js") @Scripts.Render("~/Scripts/CodeMirror/addon/hint/sql-hint.js") @Scripts.Render("~/Scripts/CodeMirror/mode/sql/sql.js") @Scripts.Render("~/Scripts/CodeMirror/mode/vb/vb.js") <!-- Report Designer component dependent scripts --> @Scripts.Render("~/Scripts/bold-reports/v2.0/common/bold.reports.common.min.js") @Scripts.Render("~/Scripts/bold-reports/v2.0/common/bold.reports.widgets.min.js") <!-- Report Designer component script--> @Scripts.Render("~/Scripts/bold-reports/v2.0/bold.report-viewer.min.js") @Scripts.Render("~/Scripts/bold-reports/v2.0/bold.report-designer.min.js") @Scripts.Render("~/Scripts/bold-reports/v2.0/localization/l10n/ej.localetexts.fr-FR.min.js") @Scripts.Render("~/Scripts/bold-reports/v2.0/localization/reportviewer/ej.localetexts.fr-FR.min.js") @Scripts.Render("~/Scripts/bold-reports/v2.0/localization/reportdesigner/ej.localetexts.fr-FR.min.js") <div class="container body-content" style="height:100%;width:100%;"> @RenderBody() @Html.Bold().ScriptManager() </div> @RenderSection("scripts", required: false) </body> </html>
-