feat: translate audit trail actions and entities across languages (#2903)

save account keys have been cleaned up and replaced by the single, consistent SAVINGSACCOUNT key in every translation file.
This commit is contained in:
Shubham Kumar
2025-12-15 10:28:45 -06:00
committed by GitHub
parent 3ec93a79d1
commit bc40094342
18 changed files with 652 additions and 8 deletions
+20 -3
View File
@@ -1,11 +1,28 @@
import { Pipe, PipeTransform, inject } from '@angular/core';
import { Pipe, PipeTransform, inject, OnDestroy } from '@angular/core';
import { TranslateService } from '@ngx-translate/core';
import { Subscription } from 'rxjs';
@Pipe({ name: 'translateKey', standalone: true })
export class TranslatePipe implements PipeTransform {
@Pipe({ name: 'translateKey', standalone: true, pure: false })
export class TranslatePipe implements PipeTransform, OnDestroy {
private translateService = inject(TranslateService);
private onLangChange: Subscription;
constructor() {
this.onLangChange = this.translateService.onLangChange.subscribe(() => {
// Trigger change detection when language changes
});
}
ngOnDestroy(): void {
if (this.onLangChange) {
this.onLangChange.unsubscribe();
}
}
transform(attributeValue: any, group: string, prefix: string = 'labels'): string {
if (!attributeValue) {
return attributeValue;
}
const translationKey = `${prefix}.${group}.${attributeValue}`;
return this.translateService.instant(translationKey);
}