Datatable header text in a multilanguage application

Hi webix team, what is the best way to translate the datatable header text in a multilanguage application. I worked with getColumnConfig(id).header[0].text to get the text of an id, but how I can change it? A lot of thanks, Rainer

From our experience, the best solution is to embed translattion function directly in to the config.

Something like

{ view:"datatable", columns:[
   { id:"title", header:_("Title")}
]}

Where _ is a call for the translation function, which will return text in the current locale ( for example http://airbnb.io/polyglot.js/ )

Hi maksim,
very good idea,
thanks

Hi, I added the translate function to the header title e.g. header:translate(“Title”) and a view “richselect” with languages and a $$(id).attachEvent(“onChange”,function(newvalue,oldvalue) to the richselect.
What is the best way to connect the event and the translate function? Thanks Rainer

You need to reconstruct UI ( destroy the current one and run the code for UI initialization ) or as the ultimate way of UI reconstruction you can reload the page.

I generated project using webixjet, how can I add more language in webix/codebase/i18n/en.js
I try add key some like this still doesn’t work


webix.i18n.locales["en-US"]={
...
	title:"Judulnya",
...

and in my view


		view: "datatable",
		columns: [{
			id: "name",
			 header:_("title"),
			//header:webix.i18n.title,
		}, ],

and how can I implement this to load the lang from database ?