WEB-538:fix translation issue in notes module (#2955)

This commit is contained in:
Shubham Kumar
2026-01-01 14:06:19 -06:00
committed by GitHub
parent e52691bf85
commit b00c60ef27
2 changed files with 14 additions and 16 deletions
@@ -18,14 +18,7 @@
cdkAutosizeMinRows="2"
></textarea>
</mat-form-field>
<button
type="button"
mat-raised-button
class="flex-1"
color="primary"
[disabled]="!noteForm.valid"
(click)="addNote()"
>
<button type="submit" mat-raised-button class="flex-1" color="primary" [disabled]="!noteForm.valid">
<fa-icon icon="plus" class="m-r-10"></fa-icon>{{ 'labels.buttons.Add' | translate }}
</button>
</form>
@@ -41,7 +34,9 @@
</div>
<div class="note-footer">
<div class="note-meta">
<div class="created-by">Created by {{ entityNote.createdByUsername }}</div>
<div class="created-by">
{{ 'labels.inputs.Created By' | translate }} {{ entityNote.createdByUsername }}
</div>
<div class="created-date">
{{ entityNote.createdOn | dateFormat }}
</div>
@@ -52,18 +47,18 @@
mat-raised-button
color="primary"
(click)="editNote(entityNote.id, entityNote.note, i)"
title="Edit note"
[title]="'labels.heading.Edit Note' | translate"
>
Edit
{{ 'labels.buttons.Edit' | translate }}
</button>
<button
type="button"
mat-raised-button
color="warn"
(click)="deleteNote(entityNote.id, i)"
title="Delete note"
[title]="('labels.inputs.Note' | translate) + ': ' + ('labels.buttons.Delete' | translate)"
>
Delete
{{ 'labels.buttons.Delete' | translate }}
</button>
</div>
</div>
@@ -11,6 +11,7 @@ import { CdkTextareaAutosize } from '@angular/cdk/text-field';
import { FaIconComponent } from '@fortawesome/angular-fontawesome';
import { DateFormatPipe } from '../../../pipes/date-format.pipe';
import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
import { TranslateService } from '@ngx-translate/core';
@Component({
selector: 'mifosx-entity-notes-tab',
@@ -30,6 +31,7 @@ export class EntityNotesTabComponent implements OnInit {
private clientsService = inject(ClientsService);
private groupsService = inject(GroupsService);
private dialog = inject(MatDialog);
private translateService = inject(TranslateService);
@ViewChild('formRef', { static: true }) formRef: any;
@@ -69,14 +71,14 @@ export class EntityNotesTabComponent implements OnInit {
required: true,
value: noteContent,
controlType: 'input',
label: 'Note'
label: this.translateService.instant('labels.inputs.Note')
}
],
layout: {
columns: 1,
addButtonText: 'Confirm'
},
title: 'Edit Note'
title: this.translateService.instant('labels.heading.Edit Note')
}
});
editNoteDialogRef.afterClosed().subscribe((response: any) => {
@@ -87,8 +89,9 @@ export class EntityNotesTabComponent implements OnInit {
}
deleteNote(noteId: string, index: number) {
const noteLabel = this.translateService.instant('labels.inputs.Note');
const deleteNoteDialogRef = this.dialog.open(DeleteDialogComponent, {
data: { deleteContext: `Note: ${this.entityNotes[index].note}` }
data: { deleteContext: `${noteLabel}: ${this.entityNotes[index].note}` }
});
deleteNoteDialogRef.afterClosed().subscribe((response: any) => {
if (response.delete) {