Hi,
How to get language to translate in a datacolection?, for example
in a jetview i get translation by this way, example:
/*user.js*/
export default class UserView extends JetView {
config() {
const _ = this.app.getService("locale")._;
var titlebar = { view: "template", template:"_(title_bar)", type: "header", fillspace: true };
return titlebar;
}
}
But in records.js file, i have datacollections only.
It’s possible to get the translations in this type of files?.
I want to import records.js to other classes but already translated the datacollections.
/*records.js*/
const _ = this.app.getService("locale")._;
export const dataColOne = new webix.DataCollection({
data: [
{ id: 1, title: _("title_1") },
{ id: 2, title: _("title_2") },
{ id: 3, title: _("title_3") }
]
});
export const dataColTwo = new webix.DataCollection({
data: [
{ id: 1, title: _("word_1") },
{ id: 2, title: _("word_2") },
{ id: 3, title: _("word_3") }
]
});
In this case “const _ = this.app.getService(“locale”)._” I get the error “this.app is undefined”, obviously.
Possibly my approach is not correct, I do not know how to do this, any help is appreciated.
Thanks in advance.