mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-04-02 05:23:14 +00:00
* rmeove icon from toggles * fix: comments * fix: more comments * always show public domains even if interface private, only show delete on domains * fix: even more comments * fix: last comments * feat: empty state for dashboard * rework welcome, dlete update-toast, minor * translation improvements --------- Co-authored-by: waterplea <alexander@inkin.ru>
22 lines
678 B
TypeScript
22 lines
678 B
TypeScript
import { inject, Injectable, Pipe, PipeTransform } from '@angular/core'
|
|
import { ENGLISH } from './dictionaries/en'
|
|
import { I18N, i18nKey } from './i18n.providers'
|
|
|
|
@Pipe({
|
|
standalone: true,
|
|
name: 'i18n',
|
|
pure: false,
|
|
})
|
|
@Injectable({ providedIn: 'root' })
|
|
export class i18nPipe implements PipeTransform {
|
|
private readonly i18n = inject(I18N)
|
|
|
|
// @TODO uncomment to make sure translations are present
|
|
transform(englishKey: string | null | undefined): string | undefined {
|
|
// transform(englishKey: i18nKey | null | undefined): string | undefined {
|
|
return englishKey
|
|
? this.i18n()?.[ENGLISH[englishKey as i18nKey]] || englishKey
|
|
: undefined
|
|
}
|
|
}
|