Localization
25 Mar 20212 minutes to read
Localization in pivot gauge control
You can localize the pivot gauge control texts with a collection of localized strings by using the “ej.PivotGauge.Locale” for different cultures.
NOTE
By default, the pivot gauge control is localized in “en-US”.
Following code example illustrates how to localize the pivot gauge based on the “French” culture:
<script>
ej.PivotGauge.Locale["fr-FR"] = {
RevenueGoal: "Objectif de chiffre d'affaires",
RevenueValue: "Valeur du chiffre d'affaires"
}
</script>
<ej:PivotGauge ID="PivotGauge1" runat="server" Locale="fr-FR">
</ej:PivotGauge>
Following table localizes the in-built keywords to “French” culture for the pivot gauge:
Keywords | Values |
---|---|
RevenueGoal | "Objectif de chiffre d'affaires" |
RevenueValue | "Valeur du chiffre d'affaires " |
Localization and globalization of cube info
The content displayed within the pivot gauge control is obtained from the OLAP cube. The following are the steps that should be done to get the localized and globalized cube content.
To get the localized string based on different cultures, set the “Locale Identifier” in the connection string to a specific culture in the OLAP cube. The attribute is set for the pivot gauge in client mode as shown below:
<ej:PivotGauge ID="PivotGauge1" runat="server" Locale="fr-FR">
<DataSource Data="http://bi.syncfusion.com/olap/msmdpump.dll;Locale Identifier=1036;"></DataSource>
</ej:PivotGauge>
For server mode, set the “Culture” and “OverrideDefaultFormatStrings” properties in the OlapDataManager class to a specific culture along with the setting “Locale Identifier” in the connection string.
//1036 refers to “fr-FR” culture.
string connectionString = "Data Source=localhost; Initial Catalog=Adventure Works DW; Locale Identifier=1036;";
DataManager = new OlapDataManager(connectionString);
DataManager.Culture = new System.Globalization.CultureInfo(1036);
DataManager.OverrideDefaultFormatStrings = true;