mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
[i18n] Translate sortable_column (#28648)
* localize sortable_column.js * Fix typos
This commit is contained in:
parent
c25fbd323f
commit
bc6bdb4574
1 changed files with 12 additions and 3 deletions
|
@ -22,7 +22,7 @@ import template from './sortable_column.html';
|
|||
|
||||
const app = uiModules.get('kibana');
|
||||
|
||||
app.directive('sortableColumn', function () {
|
||||
app.directive('sortableColumn', function (i18n) {
|
||||
return {
|
||||
restrict: 'E',
|
||||
transclude: true,
|
||||
|
@ -45,8 +45,17 @@ app.directive('sortableColumn', function () {
|
|||
}
|
||||
|
||||
getAriaLabel() {
|
||||
const direction = this.isSortedAscending() ? 'descending' : 'ascending';
|
||||
return `Sort ${this.field} ${direction}`;
|
||||
const isAscending = this.isSortedAscending();
|
||||
if(isAscending) {
|
||||
return i18n('common.ui.sortableColumn.sortAscendingAriaLabel', {
|
||||
defaultMessage: 'Sort {field} ascending',
|
||||
values: { field: this.field },
|
||||
});
|
||||
}
|
||||
return i18n('common.ui.sortableColumn.sortDescendingAriaLabel', {
|
||||
defaultMessage: 'Sort {field} descending',
|
||||
values: { field: this.field },
|
||||
});
|
||||
}
|
||||
|
||||
isSorted() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue