feat: add english and hungarian translations
This commit is contained in:
@@ -1,16 +1,24 @@
|
||||
import { Pipe, PipeTransform } from '@angular/core';
|
||||
import { inject, Pipe, PipeTransform } from '@angular/core';
|
||||
import { Umpire } from 'db';
|
||||
import { TranslationService } from './i18n/translation.service';
|
||||
|
||||
@Pipe({
|
||||
name: 'fullname',
|
||||
standalone: true
|
||||
standalone: true,
|
||||
pure: false
|
||||
})
|
||||
export class FullnamePipe implements PipeTransform {
|
||||
readonly translationService = inject(TranslationService);
|
||||
|
||||
transform(value: Umpire | undefined, ...args: unknown[]): string {
|
||||
if (typeof value === 'undefined') {
|
||||
return '';
|
||||
}
|
||||
// TODO: in case of multilang, change here
|
||||
|
||||
if (this.translationService.language() === 'en') {
|
||||
return value.firstName + ' ' + value.lastName;
|
||||
}
|
||||
|
||||
return value.lastName + ' ' + value.firstName;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user