Pivot Table & Charts Component Documentation

Localizing component

On our website you can see localized version of Pivot Table in Demos – Localize Pivot demo, for example to Spanish, Portuguese, Chinese, etc. The following article describes how Pivot Table can be localized.

Default language for all text elements in Pivot Table is English. The full process of component localization involves three steps:

Step 1. Create your localization XML file

Localization XML file is the XML file that has the list of all text messages and labels that are used in Pivot Table and can be localized.

If you plan to use one of localizations, that is used in our demos, you are free to download respective localization file from our site. Just click the file with language below or right click and save locally.

If you have downloaded one of the above files, you can jump to “Step 2. Load localization XML file into Pivot Table“.

If you use different language, you can create your own localization file. We recommend using English localization file as a template. Download it, make a copy and replace all English texts with your own.

In the following example, we localize Calculated Values window in Pivot to French.

The original section of localization file looks as follows.

  <measureBox>Drag Values To Formula</measureBox>
  <measureName>Value name</measureName>

Now we replace the respective terms with French.

  <measureBox>Deplacez valeur a la formule</measureBox>
  <measureName>Nom de la valeur</measureName>

Once the Localization XML file is loaded (see next step), your Pivot Table component should show the following changes in Calculated Values view


NOTE: If translated terms contain not only alphabetical symbols, write them in [CDATA[ ]] blocks to avoid XML parsing problem.

Your localization can be partial. For example, if you don’t need to localize Pivot Table completely, you can replace only those XML nodes that are necessary to translate. If certain label translations are not mentioned in the Localization XML file, they will be set to default English values.

Step 2. Load localization XML file into Pivot Table

To enable localization you should add path to the localization file in the Report XML file. E.g. as below

  <param name="localSettingsUrl"><![CDATA[local.english.xml]]></param>

Note: We recommend writing file path in [CDATA[ ]] block to avoid XML parsing problems.

After the Report XML file is saved, you can reload Pivot Table to see localization changes effective.

Additional implementation notes:

  • Every saved Report XML file can have its own localization file, referenced in localSettingsUrl node.
  • If you load two reports and only first one contains localSettingsUrl node, the localization will not be changed on loading of the second report.
  • Loading new report with localization changes substitutes localization that was set before.

Step 3. Toolbar localization (Flash/HTML5 only).


Also, it’s possible to localize a toolbar, which easily integrates with version 2.0 and higher. Follow the steps below:

1. Create a JavaScript Object with translations. Here are the default labels:

var Labels = {
  // Menu
  CONNECT: "Connect",
  OPEN: "Open",
  LOCAL_REPORT: "Local report",
  REMOTE_REPORT: "Remote report",
  SAVE: "Save",
  GRID: "Grid",
  CHARTS: "Charts",
  CHARTS_BAR: "Bar",
  CHARTS_LINE: "Line",
  CHARTS_SCATTER: "Scatter",
  CHARTS_PIE: "Pie",
  CHARTS_BAR_STACK: "Bar stack",
  CHARTS_BAR_LINE: "Bar line",
  CHARTS_MULTIPLE: "Multiple values",
  FORMAT: "Format",
  FORMAT_CELLS: "Format cells",
  CONDITIONAL_FORMATTING: "Conditional formatting",
  OPTIONS: "Options",
  STYLES: "Styles",
  STYLES_BLUEBERRY: "Blueberry",
  STYLES_ASPHALT: "Asphalt",
  STYLES_NAVY: "Navy",
  STYLES_EMERALD: "Emerald",
  STYLES_COCOA: "Cocoa",
  STYLES_RASPBERRY: "Raspberry",
  FULLSCREEN: "Fullscreen",
  ZOOM: "Zoom",
  EXPORT: "Export",
  EXPORT_PRINT: "Print",
  EXPORT_EXCEL: "To Excel",
  EXPORT_IMAGE: "To Image",
  FIELDS: "Fields",
  // General
  OK: "OK",
  APPLY: "Apply",
  CANCEL: "Cancel",
  VALUE: "Value",
  // Connect
  OPEN_REMOTE_CSV: "Open remote CSV",
  OLAP_CONNECTION_TOOL: "OLAP connection tool",
  SELECT_DATA_SOURCE: "Select data source",
  SELECT_CATALOG: "Select catalog",
  SELECT_CUBE: "Select cube",
  PROXY_URL: "Proxy URL",
  DATA_SOURCE_INFO: "Data Source Info",
  CATALOG: "Catalog",
  CUBE: "Cube",
  CREDENTIALS: "credentials",
  USERNAME: "Username",
  PASSWORD: "Password",
  // Report
  OPEN_REMOTE_REPORT: "Open remote report",
  // Format
  TEXT_ALIGN: "Text align",
  ALIGN_LEFT: "left",
  ALIGN_RIGHT: "right",
  NONE: "None",
  SPACE: "(Space)",
  THOUSAND_SEPARATOR: "Thousand separator",
  DECIMAL_SEPARATOR: "Decimal separator",
  DECIMAL_PLACES: "Decimal places",
  CURRENCY_SYMBOL: "Currency symbol",
  CURRENCY_ALIGN: "Currency align",
  NULL_VALUE: "Null value",
  // Conditional
  ADD_CONDITION: "+ Add condition",
  LESS_THAN: "Less than",
  LESS_THAN_OR_EQUAL: "Less than or equal to",
  GREATER_THAN: "Greater than",
  GREATER_THAN_OR_EQUAL: "Greater than or equal to",
  EQUAL_TO: "Equal to",
  NOT_EQUAL_TO: "Not equal to",
  BETWEEN: "Between",
  ALL_VALUES: "All values",
  // Options
  LAYOUT_OPTIONS: "Layout options",
  GRAND_TOTALS: "Grand totals",
  SUBTOTALS: "subTotals",
  OFF_FOR_ROWS_AND_COLUMNS: "Off for rows and columns",
  ON_FOR_ROWS_AND_COLUMNS: "On for rows and columns",
  ON_FOR_ROWS: "On for rows only",
  ON_FOR_COLUMNS: "On for columns only",
  DO_NOT_SHOW_SUBTOTALS: "Do not show subtotals",
  SHOW_ALL_SUBTOTALS: "Show all subtotals",
  // Export PDF
  CHOOSE_PAGE_ORIENTATION: "Choose page orientation",
  LANDSCAPE: "Landscape",
  PORTRAIT: "Portrait"

2. Pass translations to flexmonster.embedPivotComponent():

flexmonster.embedPivotComponent("flexmonster/", "pivotContainer","100%", "500", {
  configUrl : "config.xml"
}, true, Labels);
Suggest Edit