mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-04-04 06:19:44 +00:00
* fix Tor logs actually fetching od logs * chore: update to Angular 18 * chore: update to Angular 19 * bump patchDB * chore: update Angular * chore: fix setup-wizard success page * chore: fix * chore: fix * chore: fix * chore: fix --------- Co-authored-by: Matt Hill <mattnine@protonmail.com> Co-authored-by: Aiden McClelland <me@drbonez.dev>
19 lines
521 B
TypeScript
19 lines
521 B
TypeScript
import { inject, Injectable, Pipe, PipeTransform } from '@angular/core'
|
|
import { ENGLISH } from './dictionaries/en'
|
|
import { I18N, i18nKey } from './i18n.providers'
|
|
|
|
@Pipe({
|
|
name: 'i18n',
|
|
pure: false,
|
|
})
|
|
@Injectable({ providedIn: 'root' })
|
|
export class i18nPipe implements PipeTransform {
|
|
private readonly i18n = inject(I18N)
|
|
|
|
transform(englishKey: i18nKey | null | undefined): string | undefined {
|
|
return englishKey
|
|
? this.i18n()?.[ENGLISH[englishKey as i18nKey]] || englishKey
|
|
: undefined
|
|
}
|
|
}
|