Flexmonster - Localization

HTML

<link rel="stylesheet" href="https://s3.amazonaws.com/flexmonster/2.3/demo.css">
<script src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
<script src="https://cdn.flexmonster.com/2.4/flexmonster.js"></script>

<button onclick="setLocalization('en')">English</button>
<button onclick="setLocalization('fr')">Français</button>
<button onclick="setLocalization('es')">Español</button>
<button onclick="setLocalization('pr')">Português</button>
<button onclick="setLocalization('ch')">中国的</button>
<button onclick="setLocalization('ua')">Українська</button>
<div id="pivot-container"></div>

JavaScript

function setLocalization(lang) {
  pivot.setReport({
    dataSource: {
      dataSourceType: "csv",
      filename: "data/data-" + lang + ".csv"
    },
    localization: "loc/" + lang + ".json"
  });
}

var pivot = $("#pivot-container").flexmonster({
  global: {
    localization: "loc/en.json"
  },
  report: {
    dataSource: {
      dataSourceType: "csv",
      filename: "data/data-en.csv"
    },
    options: {
 grid: {
                                showTotals: false,
                                showGrandTotals: "on",
                                type : "flat"
                            },         
      configuratorActive: false
    }
  },
  width: "100%",
  height: 430,
  toolbar: true,
  componentFolder: "https://cdn.flexmonster.com/2.3/"
});