@@ -22,6 +22,8 @@ import { ElementPool } from './element-pool';
2222import { TableSelection } from './table-selection' ;
2323import { mapLayout , Layout } from './layout' ;
2424import { areRowsEqual } from './utils' ;
25+ import { Languages } from '../date-picker/date.types' ;
26+ import translate from '../../global/translations' ;
2527
2628const FIRST_PAGE = 1 ;
2729
@@ -158,6 +160,12 @@ export class Table {
158160 @Prop ( )
159161 public selection : object [ ] ;
160162
163+ /**
164+ * Defines the language for translations.
165+ */
166+ @Prop ( { reflect : true } )
167+ public language : Languages = 'en' ;
168+
161169 /**
162170 * Emitted when `mode` is `remote` and the table is loading new data. The
163171 * consumer is responsible for giving the table new data
@@ -852,13 +860,15 @@ export class Table {
852860 style = { { display : showSelectAll ? 'inline-block' : 'none' } }
853861 >
854862 < limel-checkbox
863+ class = "hide-label"
855864 onChange = { this . selectAllOnChange }
856865 disabled = { this . data . length === 0 }
857866 checked = { this . tableSelection ?. hasSelection }
858867 indeterminate = {
859868 this . tableSelection ?. hasSelection &&
860869 this . selection ?. length < this . data . length
861870 }
871+ label = { this . getTranslation ( 'table.select-all' ) }
862872 />
863873 </ div >
864874 ) ;
@@ -877,4 +887,8 @@ export class Table {
877887 </ div >
878888 ) ;
879889 }
890+
891+ private getTranslation = ( key : string ) => {
892+ return translate . get ( key , this . language ) ;
893+ } ;
880894}
0 commit comments