From 2c9234a441a72150dca93fbf747a33d3c6020302 Mon Sep 17 00:00:00 2001 From: gkbishnoi07 Date: Sun, 11 Oct 2026 09:52:27 +0000 Subject: [PATCH 1/6] fix(dialog): localize alert heading and ok/cancel buttons The shared CommonDialogComponent derived the alert heading from the English status word and defaulted the OK/Cancel labels to the English literals 'OK' and 'Cancel', so dialogs stayed partly English in Hindi/Assamese. Add an `alertHeading` getter that reads `alerts.{info,success,warning,error}`, bind the button labels to `common.ok` / `common.cancel` with an English fallback, and drop the hardcoded service defaults. Added the five standard UI-word keys (info/success/warning/error, cancel) with real Hindi/Assamese values; English values are unchanged. --- .../common-dialog.component.html | 30 +++++++++---------- .../common-dialog/common-dialog.component.ts | 24 +++++++++++++++ .../core/services/confirmation.service.ts | 18 +++++------ src/assets/Assamese.json | 7 ++++- src/assets/English.json | 7 ++++- src/assets/Hindi.json | 7 ++++- 6 files changed, 66 insertions(+), 27 deletions(-) diff --git a/src/app/app-modules/core/components/common-dialog/common-dialog.component.html b/src/app/app-modules/core/components/common-dialog/common-dialog.component.html index d0883bb..713c807 100644 --- a/src/app/app-modules/core/components/common-dialog/common-dialog.component.html +++ b/src/app/app-modules/core/components/common-dialog/common-dialog.component.html @@ -36,7 +36,7 @@

{{ message }}

@@ -56,7 +56,7 @@ dialogHeader; context: { status: status, - text: (status === 'warn' ? 'warning' : status) | titlecase, + text: alertHeading, } " > @@ -68,7 +68,7 @@ (click)="dialogRef.close()" cdkFocusInitial > - {{ btnOkText }} + {{ btnOkText || currentLanguageSet?.common?.ok || 'Ok' }} @@ -88,14 +88,14 @@ />
@@ -117,14 +117,14 @@ >
@@ -152,14 +152,14 @@
@@ -185,7 +185,7 @@ (click)="dialogRef.close(true)" cdkFocusInitial > - {{ btnOkText }} + {{ btnOkText || currentLanguageSet?.common?.ok || 'Ok' }} @@ -202,7 +202,7 @@
@@ -231,7 +231,7 @@

diff --git a/src/app/app-modules/core/components/common-dialog/common-dialog.component.ts b/src/app/app-modules/core/components/common-dialog/common-dialog.component.ts index ba88581..9c11bb8 100644 --- a/src/app/app-modules/core/components/common-dialog/common-dialog.component.ts +++ b/src/app/app-modules/core/components/common-dialog/common-dialog.component.ts @@ -162,4 +162,28 @@ export class CommonDialogComponent implements OnInit { this.currentLanguageSet = this.languageComponent.currentLanguageObject; } // -----End------ + + /** + * Localized heading for the alert dialog. The status word (info/success/ + * warning/error) used to be shown raw via the titlecase pipe, so the heading + * was always English regardless of the selected language. Read it from the + * language set, falling back to the English label when a translation is + * missing. + */ + get alertHeading(): string { + const status = (this.status || 'info').toLowerCase(); + const key = + status === 'warn' ? 'warning' : status === 'fail' ? 'error' : status; + const translated = this.currentLanguageSet?.alerts?.[key]; + if (translated) { + return translated; + } + const fallback: { [k: string]: string } = { + info: 'Info', + success: 'Success', + warning: 'Warning', + error: 'Error', + }; + return fallback[key] || key.charAt(0).toUpperCase() + key.slice(1); + } } diff --git a/src/app/app-modules/core/services/confirmation.service.ts b/src/app/app-modules/core/services/confirmation.service.ts index 59d3a74..a11afb0 100644 --- a/src/app/app-modules/core/services/confirmation.service.ts +++ b/src/app/app-modules/core/services/confirmation.service.ts @@ -53,8 +53,8 @@ export class ConfirmationService { public confirm( title: string, message: string, - btnOkText = 'OK', - btnCancelText = 'Cancel', + btnOkText?: string, + btnCancelText?: string, ): Observable { const dialogRef = this.createDialog('420px', true); const instance = dialogRef.componentInstance!; @@ -70,7 +70,7 @@ export class ConfirmationService { public alert( message: string, status = 'info', - btnOkText = 'OK', + btnOkText?: string, ): ZardDialogRef { // Non-mask-closable: an alert should stay until the user clicks OK. When it // was mask-closable, a programmatic click elsewhere (e.g. the report's @@ -89,7 +89,7 @@ export class ConfirmationService { titleAlign = 'center', messageAlign = 'center', btnOkText = 'Submit', - btnCancelText = 'Cancel', + btnCancelText?: string, ): Observable { const dialogRef = this.createDialog('420px', true); const instance = dialogRef.componentInstance!; @@ -107,7 +107,7 @@ export class ConfirmationService { titleAlign = 'center', messageAlign = 'center', btnOkText = 'Submit', - btnCancelText = 'Cancel', + btnCancelText?: string, ): Observable { const dialogRef = this.createDialog('60%', true); const instance = dialogRef.componentInstance!; @@ -125,7 +125,7 @@ export class ConfirmationService { mandatories: any, titleAlign = 'center', messageAlign = 'center', - btnOkText = 'OK', + btnOkText?: string, ): Observable { const dialogRef = this.createDialog('420px', true); const instance = dialogRef.componentInstance!; @@ -142,7 +142,7 @@ export class ConfirmationService { titleAlign = 'center', messageAlign = 'center', btnOkText = 'Confirm', - btnCancelText = 'Cancel', + btnCancelText?: string, ): Observable { const dialogRef = this.createDialog('420px', true); const instance = dialogRef.componentInstance!; @@ -160,7 +160,7 @@ export class ConfirmationService { message: string, timer: number, btnOkText = 'Continue', - btnCancelText = 'Cancel', + btnCancelText?: string, ): Observable { const dialogRef = this.createDialog('420px', false); const instance = dialogRef.componentInstance!; @@ -180,7 +180,7 @@ export class ConfirmationService { titleAlign = 'center', messageAlign = 'center', btnOkText = 'Confirm', - btnCancelText = 'Cancel', + btnCancelText?: string, ): Observable { const dialogRef = this.createDialog('60%', true); const instance = dialogRef.componentInstance!; diff --git a/src/assets/Assamese.json b/src/assets/Assamese.json index 34c30c2..7705470 100644 --- a/src/assets/Assamese.json +++ b/src/assets/Assamese.json @@ -5,7 +5,8 @@ "submit": "প্ৰেৰণ কৰা", "save": "সংৰক্ষণ কৰক", "confirmation": "অনুমোদন", - "ok":"ঠিক" + "ok":"ঠিক", + "cancel": "বাতিল কৰক" }, "itemDispense": { "pharmacist": "ফার্মাচিষ্ট", @@ -32,6 +33,10 @@ "route": "পথ" }, "alerts": { + "info": "তথ্য", + "success": "সফলতা", + "warning": "সতৰ্কবাণী", + "error": "ত্ৰুটি", "confirmtoProceedFurther": "অনুগ্ৰহ কৰি আগবাঢি়বলৈ নিশ্চিত কৰক", "medicinenotavailable": "চিকিৎসা বিজ্ঞান নির্দেশ কৰা হোৱা নাই", "langNotDefinesd": "ভাষআটি নির্দিষ্টকৈ নির্দেশ কৰা হোৱা নাই", diff --git a/src/assets/English.json b/src/assets/English.json index 0859197..953cb30 100644 --- a/src/assets/English.json +++ b/src/assets/English.json @@ -5,7 +5,8 @@ "submit": "Submit", "save": "Save", "confirmation": "Confirmation", - "ok":"Ok" + "ok":"Ok", + "cancel": "Cancel" }, "itemDispense": { "pharmacist": "Pharmacist", @@ -32,6 +33,10 @@ "route": "Route" }, "alerts": { + "info": "Info", + "success": "Success", + "warning": "Warning", + "error": "Error", "confirmtoProceedFurther": "Please confirm to proceed further", "medicinenotavailable": "Medicine not available", "langNotDefinesd": "Language not defined", diff --git a/src/assets/Hindi.json b/src/assets/Hindi.json index 5b4286c..0a1dd17 100644 --- a/src/assets/Hindi.json +++ b/src/assets/Hindi.json @@ -5,7 +5,8 @@ "submit": "दर्ज करें", "save": "सुरक्षित करें", "confirmation": "पुष्टीकरण", - "ok":"ठीक" + "ok":"ठीक", + "cancel": "रद्द करें" }, "itemDispense": { "pharmacist": "फार्मासिस्ट", @@ -32,6 +33,10 @@ "route": "मार्ग" }, "alerts": { + "info": "सूचना", + "success": "सफलता", + "warning": "चेतावनी", + "error": "त्रुटि", "confirmtoProceedFurther": "आगे बढ़ने के लिए पुष्टि करें", "medicinenotavailable": "दवा उपलब्ध नहीं है", "langNotDefinesd": "भाषा परिभाषित नहीं है", From f364d0b928dc4730f2cd8a9b03c7784207fcaf8a Mon Sep 17 00:00:00 2001 From: gkbishnoi07 Date: Sun, 11 Oct 2026 09:52:40 +0000 Subject: [PATCH 2/6] fix(reports): localize monthly report month dropdown The monthly report month dropdown used a hardcoded English Jan..Dec array. Build it from the shared getCalendarMonths() helper so it follows the app language; the submitted value (month index) is unchanged. --- .../monthly-report.component.ts | 22 +++++++------------ 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/src/app/app-modules/inventory/reports/monthly-report/monthly-report.component.ts b/src/app/app-modules/inventory/reports/monthly-report/monthly-report.component.ts index 170888c..7d7c1de 100644 --- a/src/app/app-modules/inventory/reports/monthly-report/monthly-report.component.ts +++ b/src/app/app-modules/inventory/reports/monthly-report/monthly-report.component.ts @@ -41,6 +41,7 @@ import { cardImports } from 'Common-UI/v2/ui/card'; import { ZardFormImports } from 'Common-UI/v2/ui/form'; import { ZardSelectImports } from 'Common-UI/v2/ui/select'; import { ZardButtonComponent } from 'Common-UI/v2/ui/button'; +import { getCalendarMonths } from 'Common-UI/v2/ui/calendar'; @Component({ selector: 'app-monthly-report', @@ -84,25 +85,18 @@ export class MonthlyReportComponent implements OnInit, DoCheck { ).facilityName; facilities = [this.selectedFacilityName, 'All']; //BU40088124 27/7/2022 Added Facility Name dropdown in reports - months = [ - { val: '0', name: 'Jan' }, - { val: '1', name: 'Feb' }, - { val: '2', name: 'Mar' }, - { val: '3', name: 'Apr' }, - { val: '4', name: 'May' }, - { val: '5', name: 'Jun' }, - { val: '6', name: 'Jul' }, - { val: '7', name: 'Aug' }, - { val: '8', name: 'Sep' }, - { val: '9', name: 'Oct' }, - { val: '10', name: 'Nov' }, - { val: '11', name: 'Dec' }, - ]; + // Month names are localized from the selected app language (falls back to the + // English Jan..Dec short names). Built in ngOnInit once the language is known. + months: { val: string; name: string }[] = []; ngOnInit() { this.createMonthlyForm(); this.getMonth(); this.getYear(); this.fetchLanguageResponse(); + this.months = getCalendarMonths().map((name, index) => ({ + val: String(index), + name, + })); this.setSelectedFacility(); } From cb5d4a7ec20ba081c7aa0b1d2f263cd00f5ca156 Mon Sep 17 00:00:00 2001 From: gkbishnoi07 Date: Sun, 11 Oct 2026 09:52:42 +0000 Subject: [PATCH 3/6] fix(inventory): show empty-state rows in stock and indent detail popups The stock-adjustment view details, sub-store and main-store indent item popups rendered an empty table (no feedback) when the endpoint returned no rows. Add a "No records found" row (reusing the translated inventory.norecordsfound key) and localize the hardcoded "ItemList Details" title in the main-store popup. --- .../main-store-item-model.component.html | 11 ++++++++++- .../sub-store-item-model.component.html | 9 +++++++++ .../view-stock-adjustment-details.component.html | 9 +++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/src/app/app-modules/inventory/indent/indent-order-worklist/main-store-indent-order-worklist/main-store-item-model/main-store-item-model.component.html b/src/app/app-modules/inventory/indent/indent-order-worklist/main-store-indent-order-worklist/main-store-item-model/main-store-item-model.component.html index 9e7925a..d4d947a 100644 --- a/src/app/app-modules/inventory/indent/indent-order-worklist/main-store-indent-order-worklist/main-store-item-model/main-store-item-model.component.html +++ b/src/app/app-modules/inventory/indent/indent-order-worklist/main-store-indent-order-worklist/main-store-item-model/main-store-item-model.component.html @@ -2,7 +2,7 @@ class="flex items-center justify-between gap-2 border-b border-border px-6 py-4" >

- ItemList Details + {{ currentLanguageSet?.inventory?.itemListDetails || "ItemList Details" }}