Open ctjhoa opened 7 years ago
I found a workaround but it's kinda ugly
titleHeader: t('agreement.title'),
columns: computed('titleHeader', function() {
return [{
label: get(this, 'titleHeader'),
valuePath: 'metadata.title'
}];
}),
There is currently no out-of-the-box solution for this but it should be fairly easy to do by creating your own column type and overriding the label property.
In your column definition, you can pass a labelKey: 'agreement.title'
instead of label: 'Foo Bar'
and then use that via column.labelKey
in your column type.
any plans to have 'official' column types
, cell-components
, etc that are used a lot by the community?
Or even just a poll of what people have implemented to improve documentation to show the different use cases that ember-light-table
can achieve?
Import the i18n
service in the component and you can use the t
helper in the columns declaration.
baseColumns: computed(function() {
const i18n = this.get('i18n');
return [{
label: i18n.t('table.catalogue.name.key'),
valuePath: 'name'
}]
}
@alexander-alvarez Yeah I need to work on adding some more default cell & column types.
Hi, It seems that there is no ember-i18n support. For example, with
columns
:Assertion Failed: Cannot translate agreement.title. <(unknown mixin):ember591> does not have an i18n.
Is this something on the roadmap or is there another way?