@@ -95,7 +95,7 @@ import { ContainerService } from '../services/container.service';
95
95
]
96
96
} )
97
97
export class AngularSlickgridComponent < TData = any > implements AfterViewInit , OnDestroy {
98
- protected _dataset ?: any [ ] | null ;
98
+ protected _dataset ?: TData [ ] | null ;
99
99
protected _columnDefinitions ! : Column [ ] ;
100
100
protected _currentDatasetLength = 0 ;
101
101
protected _eventHandler : SlickEventHandler = new SlickEventHandler ( ) ;
@@ -358,7 +358,7 @@ export class AngularSlickgridComponent<TData = any> implements AfterViewInit, On
358
358
this . _isGridInitialized = true ;
359
359
360
360
// recheck the empty warning message after grid is shown so that it works in every use case
361
- if ( this . gridOptions && this . gridOptions . enableEmptyDataWarningMessage && Array . isArray ( this . dataset ) ) {
361
+ if ( this . gridOptions ? .enableEmptyDataWarningMessage && Array . isArray ( this . dataset ) ) {
362
362
const finalTotalCount = this . dataset . length ;
363
363
this . displayEmptyDataWarning ( finalTotalCount < 1 ) ;
364
364
}
@@ -789,7 +789,7 @@ export class AngularSlickgridComponent<TData = any> implements AfterViewInit, On
789
789
newColumnDefinitions = this . swapInternalEditorToSlickGridFactoryEditor ( newColumnDefinitions ) ;
790
790
791
791
if ( this . gridOptions . enableTranslate ) {
792
- this . extensionService . translateColumnHeaders ( false , newColumnDefinitions ) ;
792
+ this . extensionService . translateColumnHeaders ( undefined , newColumnDefinitions ) ;
793
793
} else {
794
794
this . extensionService . renderColumnHeaders ( newColumnDefinitions , true ) ;
795
795
}
@@ -835,19 +835,15 @@ export class AngularSlickgridComponent<TData = any> implements AfterViewInit, On
835
835
// translate some of them on first load, then on each language change
836
836
if ( gridOptions . enableTranslate ) {
837
837
this . extensionService . translateAllExtensions ( ) ;
838
- this . translateColumnHeaderTitleKeys ( ) ;
839
- this . translateColumnGroupKeys ( ) ;
840
838
}
841
839
842
840
this . subscriptions . push (
843
- this . translate . onLangChange . subscribe ( ( ) => {
841
+ this . translate . onLangChange . subscribe ( ( { lang } ) => {
844
842
// publish event of the same name that Slickgrid-Universal uses on a language change event
845
843
this . _eventPubSubService . publish ( 'onLanguageChange' ) ;
846
844
847
845
if ( gridOptions . enableTranslate ) {
848
- this . extensionService . translateAllExtensions ( ) ;
849
- this . translateColumnHeaderTitleKeys ( ) ;
850
- this . translateColumnGroupKeys ( ) ;
846
+ this . extensionService . translateAllExtensions ( lang ) ;
851
847
if ( gridOptions . createPreHeaderPanel && ! gridOptions . enableDraggableGrouping ) {
852
848
this . groupingService . translateGroupingAndColSpan ( ) ;
853
849
}
@@ -1407,16 +1403,6 @@ export class AngularSlickgridComponent<TData = any> implements AfterViewInit, On
1407
1403
} ) ;
1408
1404
}
1409
1405
1410
- protected translateColumnHeaderTitleKeys ( ) {
1411
- // translate all columns (including hidden columns)
1412
- this . extensionUtility . translateItems ( this . sharedService . allColumns , 'nameKey' , 'name' ) ;
1413
- }
1414
-
1415
- protected translateColumnGroupKeys ( ) {
1416
- // translate all column groups (including hidden columns)
1417
- this . extensionUtility . translateItems ( this . sharedService . allColumns , 'columnGroupKey' , 'columnGroup' ) ;
1418
- }
1419
-
1420
1406
/**
1421
1407
* Update the "internalColumnEditor.collection" property.
1422
1408
* Since this is called after the async call resolves, the pointer will not be the same as the "column" argument passed.
0 commit comments