Localization, JavaScript Programming Example of Localization

Localization, JavaScript Programming Example of Localization

If you want to change all names and titles in Pivot Chart, you can set a custom locale for the page. The programming example below will allow you to do it in the most efficient way. Don't miss the opportunity to use the free coding samples by Webix to create custom business web apps.

JS Code

webix.i18n.pivot = {
	apply: "Apply",
	bar: "Bar",
	cancel: "Cancel",
	chart: "Chart",
	chartType: "Chart type",
	columns: "Columns",
	count: "count",
	date: "date",
	datepicker: "datepicker",
	fields: "Fields",
	filters: "Filters",
	groupBy: "Group By",
	line: "Line",
	logScale: "Logarithmic scale",
	max: "max",
	min: "min",
	multicombo: "multi-select",
	operationNotDefined: "Operation is not defined",
	layoutIncorrect: "pivotLayout should be an Array instance",
	pivotMessage: "Click to configure",
	popupHeader: "Pivot Settings",
	radar: "Radar",
	radarArea: "Area Radar",
	rows: "Rows",
	select: "select",
	settings: "Settings",
	stackedBar: "Stacked Bar",
	sum: "sum",
	text: "text",
	total: "Total",
	values: "Values",
	valuesNotDefined: "Values or Group field are not defined",
	windowTitle: "Pivot Configuration",
	windowMessage: "move fields here"
};

webix.ui({
  id:"pivot",
  view:"pivot-chart",
  height:350,
  structure:{
    groupBy: "year",
    values: [{name:"balance", operation:"max"},{name:"oil", operation:"max"}],
    filters:[{name:"name", type:"select"}]
  },
  data:pivot_data,

  //sizes for the new locale labels
  editButtonWidth: 135,
  popup: {
    cancelButtonWidth: 120,
    applyButtonWidth: 120,
    logScaleLabelWidth: 155,
    chartTypeLabelWidth: 110,
    chartTypeWidth: 290
  }
});