mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 02:11:53 +00:00
trigger chnage detection for localize pipe and round out implementing localize pipe for consistency even though not needed
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
{{ pkg.title }}
|
||||
</span>
|
||||
<span class="detail-description">
|
||||
{{ pkg.description.short }}
|
||||
{{ pkg.description.short | localize }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { CommonModule } from '@angular/common'
|
||||
import { NgModule } from '@angular/core'
|
||||
import { RouterModule } from '@angular/router'
|
||||
import { SharedPipesModule, TickerComponent } from '@start9labs/shared'
|
||||
import { LocalizePipe, SharedPipesModule, TickerComponent } from '@start9labs/shared'
|
||||
import { ItemComponent } from './item.component'
|
||||
|
||||
@NgModule({
|
||||
declarations: [ItemComponent],
|
||||
exports: [ItemComponent],
|
||||
imports: [CommonModule, RouterModule, SharedPipesModule, TickerComponent],
|
||||
imports: [CommonModule, RouterModule, SharedPipesModule, TickerComponent, LocalizePipe],
|
||||
})
|
||||
export class ItemModule {}
|
||||
|
||||
@@ -6,7 +6,7 @@ import {
|
||||
output,
|
||||
} from '@angular/core'
|
||||
import { MarketplacePkgBase } from '../../types'
|
||||
import { CopyService, i18nPipe } from '@start9labs/shared'
|
||||
import { CopyService, i18nPipe, LocalizePipe } from '@start9labs/shared'
|
||||
import { DatePipe } from '@angular/common'
|
||||
import { MarketplaceItemComponent } from './item.component'
|
||||
|
||||
@@ -71,7 +71,7 @@ import { MarketplaceItemComponent } from './item.component'
|
||||
<div class="background-border box-shadow-lg shadow-color-light">
|
||||
<div class="box-container">
|
||||
<h2 class="additional-detail-title">{{ 'Description' | i18n }}</h2>
|
||||
<p [innerHTML]="pkg().description.long"></p>
|
||||
<p [innerHTML]="pkg().description.long | localize"></p>
|
||||
</div>
|
||||
</div>
|
||||
`,
|
||||
@@ -129,7 +129,7 @@ import { MarketplaceItemComponent } from './item.component'
|
||||
}
|
||||
`,
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
imports: [MarketplaceItemComponent, DatePipe, i18nPipe],
|
||||
imports: [MarketplaceItemComponent, DatePipe, i18nPipe, LocalizePipe],
|
||||
})
|
||||
export class MarketplaceAboutComponent {
|
||||
readonly copyService = inject(CopyService)
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user