Article information
Article relates to
Telerik Reporting Q1 2008+
Created by
Ivan Todorov, Telerik
Last modified
27 October, 2008
Last modified by
Steve, Telerik
HOW-TO Localize the Telerik Reporting Win and Web Report Viewer controls' resources to a specific language or culture. SOLUTION In the Telerik Reporting Viewer controls localized resources are stored in separate RESX resource files and are loaded according to the current UI culture settings.
The default localization mechanism provided by the .NET Framework has some restrictions, which makes it hard for someone outside the Telerik team to localize the Report Viewer controls. The problem is that the Telerik Reporting assemblies are strongly named and signed with a private key. This requires all satellite localization assemblies to be signed with the same private key as well, which of course is not possible for someone outside Telerik.
To overcome this limitation the Report Viewer controls supports an alternative mechanism for localizing its resources. Instead of providing satellite resource assemblies, the Report Viewer controls can be localized directly from RESX resource files, as long as these RESX files conform to the required naming convention and are stored in the main application directory.
For complete description of the Report Viewer controls localization please see Report Viewer Localization. Naming Conventions of the Localization Resources
Telerik Report Viewer controls use the following naming convention when searching for localized RESX resource files in the main application folder:
Telerik.ReportViewer.WebForms.Resources.[culture].resx
Telerik.ReportViewer.WinForms.Resources.[culture].resx
Here [culture] is the name of the culture for the specified localization resource. For example, to provide a localization resource for the French Belgian culture, the corresponding resource file should be named as follows:
Telerik.ReportViewer.WebForms.Resources.fr-BE.resx
Telerik.ReportViewer.WinForms.Resources.fr-BE.resx
Respectively, to provide a localization resource for the French neutral culture, the corresponding resource file should be named as follows:
Telerik.ReportViewer.WebForms.Resources.fr.resx
Telerik.ReportViewer.WinForms.Resources.fr.resx
It is possible to override the default resources for the language neutral culture, which are stored in the assembly of the Report Viewer control. In that case the resource file should be named with no culture specified, as follows:
Telerik.ReportViewer.WebForms.Resources.resx
Telerik.ReportViewer.WinForms.Resources.resx
As described above, if the current UI culture is set to French Belgian, for example, the Report Viewer control will search for localized RESX resource files inside the main application folder in the following order:
Figure 1. The above diagram illustrates a simple view of resource fallback for a UI culture set to “fr-BE”. The Report Viewer handles this case probing the “fr-BE” RESX resource file for the requested key first, and subsequently falls back to the neutral culture “fr”, ultimately looking in the default assembly resources for a value if still not found.
Adding Localization Resources for the Report Viewer controls
Distributing an Application with a Localized Report Viewer
In order to distribute an application that uses Telerik Reporting with a localized Report Viewer, one should distribute all of the required localization RESX resource files, in addition to the main application assemblies. For Web Sites and Web Applications the localization RESX resource files should be placed in the “App_GlobalResources” folder. For Windows Forms Applications the RESX files should be put in the same directory, where the application is installed.
SEE ALSO
Resources Buy Try