Localization Support
23 Oct 20196 minutes to read
Localization is the key feature for providing software solutions targeted at global users. Essential BI OLAP client for WPF allows users to localize the control to a specific locale. The following document briefly explains the step by step procedure to localize an OLAP client for the WPF control.
Localizing the OLAP client in an application
The OLAP client for WPF supports “resx” based localization. The following steps should be performed to localize the control.
- Translation.
- Resource file and file name conventions.
-
tag inclusion into the project file. - Specifying the CurrentUICulture.
See Also
Getting Started
Translation
The first step in localization is translating the strings that can be localized to the destination locale. Basically, OlapClient.WPF contains control assemblies such as OlapChart.WPF and OlapGrid.WPF and tools assemblies such as OlapShared.WPF and OlapTools.WPF within it. So, it is mandatory to localize those assemblies. The following tables contain the localization keys and strings to be localized for OlapClient.WPF, OlapChart.WPF, OlapGrid.WPF, OlapShared.WPF, and OlapTools.WPF assemblies. Translate the second column in each table, which contains the strings to be localized to the target locale.
NOTE
Localization key field should be same for all locales. Do not translate it.
Localization strings table for OlapClient.WPF
Localization Key | Strings to be localized |
---|---|
OlapClient_ChartTabHeader | Chart |
OlapClient_ChartToolbar_ChartColorPalette_ToolTip | Chart Color Palette |
OlapClient_ChartToolbar_ChartTypes_ToolTip | Chart Types |
OlapClient_ChartToolbar_Export_ToolTip | Exports Chart as an Image |
OlapClient_ChartToolbar_ExportPdf_ToolTip | Export to PDF |
OlapClient_ChartToolbar_ExportWord_ToolTip | Export to Word |
OlapClient_ChartToolbar_Print_ToolTip | Print Chart |
OlapClient_ChartToolbar_PrintMode_ToolTip | Print Mode |
OlapClient_ChartToolbar_ShowAppearanceDialog_ToolTip | Show Chart Appearance Dialog |
OlapClient_ChartToolbar_ShowLegend_ToolTip | Show Legend |
OlapClient_ColumnAxis_HeaderText | Columns (Categorical) |
OlapClient_ColumnRowSubsetFilter_ToolTip | Subset Filter |
OlapClient_Connect_Dlg_Browse | Browse |
OlapClient_Connect_Dlg_Cancel | Cancel |
OlapClient_Connect_Dlg_Connection_String_Header | Connection String |
OlapClient_Connect_Dlg_Credential | Credential |
OlapClient_Connect_Dlg_Data_Source_Header | Data source |
OlapClient_Connect_Dlg_DatabaseName | Database Name: |
OlapClient_Connect_Dlg_EnterCredential_Header | Enter credentials |
OlapClient_Connect_Dlg_Header | Server options |
OlapClient_Connect_Dlg_Offline_Cube_Header | Offline Cube |
OlapClient_Connect_Dlg_Ok | OK |
OlapClient_Connect_Dlg_Password | Password: |
OlapClient_Connect_Dlg_Server_Header | Server |
OlapClient_Connect_Dlg_ServerName | Server Name: |
OlapClient_Connect_Dlg_User_Name | User Name: |
OlapClient_ConnectOptions_Dlg_Title | Connection Option |
OlapClient_CubeDimensionBrowser_HeaderText | MetaTree |
OlapClient_CubeSelector_HeaderText | Cubes |
OlapClient_CubeSelector_ToolTip | Cube Selector |
OlapClient_GridTabHeader | Grid |
OlapClient_GridToolbar_ExportExcel_ToolTip | Export to Excel |
OlapClient_GridToolbar_ExportPdf_ToolTip | Export to PDF |
OlapClient_GridToolbar_ExportWord_ToolTip | Export to Word |
OlapClient_GridToolbar_FreezeHeaders_ToolTip | Freeze Headers |
OlapClient_GridToolbar_GridLayout_ToolTip | Grid Layouts |
OlapClient_GridToolbar_GridStyleDialog_ToolTip | Show Grid Style Dialog |
OlapClient_GridToolbar_HeaderCellTooltip_ToolTip | Show Header Cell Tooltip |
OlapClient_GridToolbar_ValueCellTooltip_ToolTip | Show Value Cell ToolTip |
OlapClient_ReportName_Dlg_ReportName | Report Name |
OlapClient_RowAxis_HeaderText | Rows (Series) |
OlapClient_SlicerAxis_HeaderText | Slicer |
OlapClient_TogglePivot_ToolTip | Toggle Pivot |
OlapClient_Toolbar_AddReport_ToolTip | Add Report |
OlapClient_Toolbar_ColumnFilter_ToolTip | Column Filter |
OlapClient_Toolbar_ConnectionOption_ToolTip | Connect to Server |
OlapClient_Toolbar_LoadReport_ToolTip | Load Report |
OlapClient_Toolbar_NewReport_ToolTip | New Report |
OlapClient_Toolbar_RemoveReport_ToolTip | Remove Report |
OlapClient_Toolbar_RenameReport_ToolTip | Rename Report |
OlapClient_Toolbar_ReportList_ToolTip | Report List |
OlapClient_Toolbar_RowFilter_ToolTip | Row Filter |
OlapClient_Toolbar_SaveAsReport_ToolTip | Save As Report |
OlapClient_Toolbar_SaveReport_ToolTip | Save Report |
OlapClient_Toolbar_ShowExpanders_ToolTip | Show Expanders |
OlapClient_Toolbar_SortingColumn_ToolTip | Sorting Column |
OlapClient_Toolbar_SortingRow_ToolTip | Sorting Row |
Localization strings table for OlapChart.WPF
Localization key | Strings to be localized |
---|---|
OlapChart_Dialog_Appearance_Tab | Appearance |
OlapChart_Dialog_Axis_Tab | Axis Labels |
OlapChart_Dialog_AxisLabel_FontColor | Font Color |
OlapChart_Dialog_AxisLabel_FontFace | Font Face |
OlapChart_Dialog_AxisLabel_FontStyle | Font Style |
OlapChart_Dialog_BackgroundStyle_Header | Background Style |
OlapChart_Dialog_BorderColor | Color: |
OlapChart_Dialog_BorderStyle_Header | Border Style |
OlapChart_Dialog_BorderWidth | Width: |
OlapChart_Dialog_CancelButton | Cancel |
OlapChart_Dialog_Chart_Tab | Chart |
OlapChart_Dialog_ChartBackground | Chart Control: |
OlapChart_Dialog_ChartInterior | Chart Interior: |
OlapChart_Dialog_ChartPalette | Chart Palette: |
OlapChart_Dialog_ChartStyle_Header | Chart Style |
OlapChart_Dialog_ChartType | Chart Type: |
OlapChart_Dialog_CircleAsSymbol | Circle |
OlapChart_Dialog_LabelVisibility_Header | Label Visibility |
OlapChart_Dialog_LegendCheckBoxVisibility | Show CheckBox |
OlapChart_Dialog_LegendPosition | Position: |
OlapChart_Dialog_Legends_Header | Legends |
OlapChart_Dialog_LegendVisibility | Show Legend |
OlapChart_Dialog_OkButton | OK |
OlapChart_Dialog_Point_Labels_Tab | Point Labels |
OlapChart_Dialog_RectangleAsSymbol | Rectangle |
OlapChart_Dialog_SeriesNameAsLabelContent | Series Name |
OlapChart_Dialog_SymbolVisibility_Header | Symbol Visibility |
OlapChart_Dialog_Title | Chart Appearance Dialog |
OlapChart_Dialog_TriangleAsSymbol | Triangle |
OlapChart_Dialog_XAxis_Header | X Axis |
OlapChart_Dialog_XValueAsLabelContent | X Value |
OlapChart_Dialog_YAxis_Header | Y Axis |
OlapChart_Dialog_YValueAsLabelContent | Y Value |
Localization strings table for OlapGrid.WPF
Localization key | Strings to be localized |
---|---|
OlapGrid_Column_Tooltip | Columns : |
OlapGrid_Dialog_Background_Color | Background Color |
OlapGrid_Dialog_Cancel | Cancel |
OlapGrid_Dialog_CellStyles | Cell Styles |
OlapGrid_Dialog_ColumnHeader | Column Header |
OlapGrid_Dialog_ColumnSummary | Column Summary |
OlapGrid_Dialog_Font_Color | Font Color |
OlapGrid_Dialog_Font_Name | Font Name |
OlapGrid_Dialog_Font_Size | Font Size |
OlapGrid_Dialog_Font_Style | Font Style |
OlapGrid_Dialog_Foreground_Color | Foreground Color |
OlapGrid_Dialog_HeaderFont | Header Font |
OlapGrid_Dialog_HeaderStyle | Header Style |
OlapGrid_Dialog_Ok | OK |
OlapGrid_Dialog_RowHeader | Row Header |
OlapGrid_Dialog_RowSummary | Row Summary |
OlapGrid_Dialog_SummaryFont | Summary Font |
OlapGrid_Dialog_SummaryStyle | Summary Style |
OlapGrid_Dialog_Title | Apply Style |
OlapGrid_Measure_Tooltip | Measure : |
OlapGrid_Row_Tooltip | Rows: |
OlapGrid_Value_Tooltip | Values : |
Localization strings table for OlapShared.WPF
Localization key | Strings to be localized |
---|---|
OlapTools_FilterSorting_Dlg_Cancel | Cancel |
OlapTools_FilterSorting_Dlg_EmptyResult_Header | Empty Results |
OlapTools_FilterSorting_Dlg_Filter_Tab | Filter |
OlapTools_FilterSorting_Dlg_Filter1_Header | Filter 1 |
OlapTools_FilterSorting_Dlg_Filter2_Header | Filter 2 |
OlapTools_FilterSorting_Dlg_FilterEmptyColumns | Filter Empty Columns |
OlapTools_FilterSorting_Dlg_FilterEmptyRows | Filter Empty Rows |
OlapTools_FilterSorting_Dlg_FilterOn | Filter On |
OlapTools_FilterSorting_Dlg_FilterOnValue | Value |
OlapTools_FilterSorting_Dlg_Header | Filtering and Sorting |
OlapTools_FilterSorting_Dlg_OnColumn | On Column |
OlapTools_FilterSorting_Dlg_OnRow | On Row |
OlapTools_FilterSorting_Dlg_Sort_Header | Sort |
OlapTools_FilterSorting_Dlg_Sort_Preserver_Hierarchy | Preserve Hierarchy |
OlapTools_FilterSorting_Dlg_SortAsc | Ascending |
OlapTools_FilterSorting_Dlg_SortDesc | Descending |
OlapTools_FilterSorting_Dlg_Sorting_Tab | Sorting |
OlapTools_FilterSorting_Dlg_SortingOn | Sorting On |
OlapTools_FilterSorting_Dlg_Update | Update |
OlapTools_FilterSorting_FilterCondition | Condition |
Localization strings table for OlapTools.WPF
Localization key | Strings to be localized |
OlapTools_Editor_Cancel | Cancel |
OlapTools_Editor_Ok | OK |
OlapTools_Editor_SplitButton_Delete_ToolTip | Delete |
OlapTools_Editor_SplitButton_MoveDown_ToolTip | Move Down |
OlapTools_Editor_SplitButton_MoveUp_ToolTip | Move Up |
OlapTools_MeasureEditor_Remove_ContextMenu | Remove |
OlapTools_MeasureEditor_Title | Measure Editor |
OlapTools_MemberEditor_CheckAll_UnCheckAll | Check / UnCheck All |
OlapTools_MemberEditor_Title | Member Editor |
OlapTools_SubsetFilter_DropDown_Text | Max number of records to be displayed. |
Resource file and file name conventions
After translating the strings that can be localized, perform the following in the application:
- Right-click the project file to create a new folder in the project.
- Select Add > New Folder.
- Rename the folder as Resources.
NOTE
The folder name should strictly be Resources.
- Now, right-click the Resources folder to create a new resource file in the Visual Studio project file.
-
Navigate to Add > New Item.
The Add New Item dialog displays as follows.
-
Select resources file from the list. Name the resource file: Syncfusion.OlapClient.WPF.fr-FR.resx and then click Add.
NOTE
The resource file name should strictly be in the format “Syncfusion.OlapClient.WPF.«Culture Code».resx”.
Examples
- Syncfusion.OlapClient.WPF.es.resx
- Syncfusion.OlapClient.WPF.ja-JP.resx
- Syncfusion.OlapClient.WPF.it-IT.resx
Similarly, for OlapChart.WPF assembly, add one more new resource file. Name the resource file as Syncfusion.OlapChart.WPF.fr-FR.resx.
For OlapGrid.WPF assembly, add one more new resource file. Name the resource file as Syncfusion.OlapGrid.WPF.fr-FR.resx.
For OlapShared.WPF assembly, add one more new resource file. Name the resource file as Syncfusion.OlapShared.WPF.fr-FR.resx.
For OlapTools.WPF assembly, add one more new resource file. Name the resource file as Syncfusion.OlapTools.WPF.fr-FR.resx.
Now, the new resource file is included successfully.
-
Copy and paste the translated locale to the resource file created in the earlier step.
<SupportedCultures> Tag inclusion into the project file
In Silverlight, you should specify the list of supported cultures using the
- Go to Solution Explorer, right-click the project file and select Unload.
- Again, right-click the project file and select Edit. Now, the project files will appear in the XML editor in Visual Studio.
-
Find the tag
, and then specify the culture code, which is already appended in the resource file name. Example:
fr-FR You can specify multiple cultures by using the (;) semicolon operator to separate the culture codes.
Example:
en-US;fr;fr-FR;ru;ru-RU; - Now, right-click the project name and select Reload.
Now, the supported cultures are included in the project file.
Specifying the CurrentUICulture
Now, you should specify the CurrentUICulture of the application. You can specify the CurrentUICulture either from Application_Startup in App.xaml.cs or from the constructor on the MainPage (If you are specifying the current culture on the main page, then make sure, this is assigned before calling the InitializeComponent method). The following code snippets describe the two variations.
public MainPage()
{
System.Threading.Thread.CurrentThread.CurrentCulture =
new System.Globalization.CultureInfo("fr-FR");
System.Threading.Thread.CurrentThread.CurrentUICulture =
new System.Globalization.CultureInfo("fr-FR");
InitializeComponent();
}
Public Sub New()
System.Threading.Thread.CurrentThread.CurrentCulture = New System.Globalization.CultureInfo("fr-FR")
System.Threading.Thread.CurrentThread.CurrentUICulture = New System.Globalization.CultureInfo("fr-FR")
InitializeComponent()
End Sub
private void Application_Startup(object sender, StartupEventArgs e)
{
System.Threading.Thread.CurrentThread.CurrentUICulture =
new System.Globalization.CultureInfo("fr-FR");
System.Threading.Thread.CurrentThread.CurrentUICulture =
new System.Globalization.CultureInfo("fr-FR");
this.RootVisual = new MainPage();
}
Private Sub Application_Startup(ByVal sender As Object, ByVal e As StartupEventArgs)
System.Threading.Thread.CurrentThread.CurrentUICulture = New System.Globalization.CultureInfo("fr-FR")
System.Threading.Thread.CurrentThread.CurrentUICulture = New System.Globalization.CultureInfo("fr-FR")
Me.RootVisual = New MainPage()
End Sub