trigger chnage detection for localize pipe and round out implementing localize pipe for consistency even though not needed

This commit is contained in:
Matt Hill
2026-02-04 14:00:20 -07:00
parent 2baf1a880b
commit 201965b809
4 changed files with 9 additions and 6 deletions

View File

@@ -1,5 +1,6 @@
import { inject, Injectable, Pipe, PipeTransform } from '@angular/core'
import { i18nService } from './i18n.service'
import { I18N } from './i18n.providers'
import { T } from '@start9labs/start-sdk'
@Pipe({
@@ -9,8 +10,10 @@ import { T } from '@start9labs/start-sdk'
@Injectable({ providedIn: 'root' })
export class LocalizePipe implements PipeTransform {
private readonly i18nService = inject(i18nService)
private readonly i18n = inject(I18N)
transform(string: T.LocaleString): string {
this.i18n() // read signal to trigger change detection on language switch
return this.i18nService.localize(string)
}
}