import { Injectable } from '@angular/core' ; import { TreeviewItem } from './treeview-item' ; @ Injectable ( ) export abstract class TreeviewI18n { abstract getText ( checkededItems , isAll ) ; abstract allCheckboxText ( ) ; abstract filterPlaceholder ( ) ; abstract filterNoItemsFoundText ( ) ; abstract tooltipCollapseExpand ( isCollapse ) ; } @ Injectable ( ) export class TreeviewI18nDefault extends TreeviewI18n { getText ( checkededItems , isAll ) { if ( isAll ) { return 'All' ; } switch ( checkededItems . length ) { case 0 : return 'Select options' ; case 1 : return checkededItems [ 0 ] . text ; default : return `${ checkededItems . length } options selected` ; } } allCheckboxText ( ) { return 'All' ; } filterPlaceholder ( ) { return 'Filter' ; } filterNoItemsFoundText ( ) { return 'No items found' ; } tooltipCollapseExpand ( isCollapse ) { return isCollapse ? 'Expand' : 'Collapse' ; } }