Configuring Multi-Language Support for D3 Visualization

Scenario: You want to localize the text properties of your dashboard so that the titles and error messages of the widgets display in a specific countries language or language culture. For example, de-DE, or en-US.

You will create a language key-value pair (KVP) JSON file that the dashboard configuration file will access when it comes across a key in the code. The value bound to the key in the KVP file, is displayed in the dashboard.

  1. You have a dashboard configuration file that you want to localize for a specific country.
  2. You have determined which string parameters from your JSON configuration file you want to localize, and you have created a key for that parameter, and for each key you have created values that you want displayed.
  1. Create a Key-Value Pair (KVP) file. Alternatively, you can open an existing file using a text editor.
    a. Open a blank text page in your text editor.
    b. Enter your Key parameters, followed by the Value (text) you want to display when the Key is read in the configuration file. Use the following syntax for each Key-Value pair:
    “Key_Text”: “Value_text“
    NOTE: the key text must be in all capital letters. The only special character allowed in the value text is the underscore (_).
    c. Once you have entered all the key-value pairs, save the file with a .JSON extension and name it according to the appropriate Language Culture Name. The file must be saved in the following directory: [GMSProjects] > Websites> [Website Name] > [Dashboard Name]> i18n.
  2. Repeat Step 1 for as many KVP language files you need; saving each with the unique Language-Culture Name.
  3. To modify the dashboardconfig.JSON file, do the following:
    a. In the text editor, open the dashboardconfig.JSON file.
    b. In the widget’s Style file, navigate to each property for which you have created a key, and set the key as value for that property.
    For example: “Title”:PIE_CHART_TITLE, where PIE_CHART_TITLE is the key in the KVP language files.
    Repeat until all string parameters have been updated.
  4. To associate a dashboard to the specific language:
    • If hosted on the management station, the logged in user’s language-culture settings are applied, and the appropriate KPV language file is accessed.
    • If hosted in a browser, in the URL, after Dashboardconfig.JSON, type &locale=[Language]. For example: Dashboardconfig.JSON&local=fr-CA