import { Component , OnInit } from '@angular/core' ; import { TinyTranslatorService } from '../model/tiny-translator.service' ; import { TranslationProject } from '../model/translation-project' ; import { TranslationFileView } from '../model/translation-file-view' ; import { TranslationUnit } from '../model/translation-unit' ; import { Router } from '@angular/router' ; @ Component ( { selector : 'app-filter-page' , templateUrl : './filter-page.component.html' , styleUrls : [ './filter-page.component.css' ] } ) export class FilterPageComponent implements OnInit { constructor ( private translationService , private router ) { } ngOnInit ( ) { } currentProject ( ) { return this . translationService . currentProject ( ) ; } currentView ( ) { return this . currentProject ( ) ? this . currentProject ( ) . translationFileView : null ; } param translationUnit onChangeTranslationUnit ( translationUnit ) { this . translationService . selectTransUnit ( translationUnit ) ; this . router . navigateByUrl ( 'translate' ) ; } hasAutotranslatedUnits ( ) { return this . currentProject ( ) && this . currentProject ( ) . autoTranslateSummaryReport ( ) && this . currentProject ( ) . autoTranslateSummaryReport ( ) . total ( ) > 0 ; } }