From b223d4fea9f4f309b8078b7593a1ca6c6da66c39 Mon Sep 17 00:00:00 2001 From: Aravindhan Alagesan Date: Fri, 2 Feb 2024 12:03:32 +0530 Subject: [PATCH 1/2] Changes related rtl language and resource bundle rendering issue fixed Signed-off-by: Aravindhan Alagesan --- .../src/app/core/parent/parent.component.html | 2 +- .../src/app/core/parent/parent.component.ts | 6 +++- .../src/app/core/services/header.service.ts | 2 +- .../shared/dialog/dialog.component.html | 2 ++ .../shared/dialog/dialog.component.ts | 6 ++-- .../mater-data-common-body.component.html | 6 ++-- .../mater-data-common-body.component.ts | 10 +++---- .../app/shared/dialog/dialog.component.html | 28 ++++--------------- .../src/app/shared/dialog/dialog.component.ts | 14 +++++++++- pmp-ui/src/assets/i18n/eng.json | 5 ++++ pmp-ui/src/assets/i18n/kan.json | 5 ++++ pmp-ui/src/assets/i18n/tam.json | 10 +++++++ 12 files changed, 60 insertions(+), 36 deletions(-) diff --git a/pmp-ui/src/app/core/parent/parent.component.html b/pmp-ui/src/app/core/parent/parent.component.html index 172e55529..ad70213ac 100644 --- a/pmp-ui/src/app/core/parent/parent.component.html +++ b/pmp-ui/src/app/core/parent/parent.component.html @@ -1,4 +1,4 @@ -
+
>
diff --git a/pmp-ui/src/app/core/parent/parent.component.ts b/pmp-ui/src/app/core/parent/parent.component.ts index 1a4672782..ffad3069c 100644 --- a/pmp-ui/src/app/core/parent/parent.component.ts +++ b/pmp-ui/src/app/core/parent/parent.component.ts @@ -26,6 +26,7 @@ export class ParentComponent implements OnInit, AfterViewInit { navItems: NavItem[]; primaryLang: string; secondaryLang: string; + sitealignment = 'ltr'; constructor(public headerService: HeaderService, public sideMenuService: SideMenuService, @@ -40,8 +41,11 @@ export class ParentComponent implements OnInit, AfterViewInit { } ngOnInit() { - this.primaryLang = this.appConfigService.getConfig()['primaryLangCode']; + this.primaryLang = this.headerService.getlanguageCode(); this.secondaryLang = this.appConfigService.getConfig()['secondaryLangCode']; + if(this.primaryLang === "ara"){ + this.sitealignment = 'rtl'; + } this.translateService.use(this.primaryLang); this.navItems = cloneObject(appConstants.navItems); if (this.headerService.getRoles()) { diff --git a/pmp-ui/src/app/core/services/header.service.ts b/pmp-ui/src/app/core/services/header.service.ts index e64551b1f..eab25de42 100644 --- a/pmp-ui/src/app/core/services/header.service.ts +++ b/pmp-ui/src/app/core/services/header.service.ts @@ -95,7 +95,7 @@ export class HeaderService { } setlanguageCode(languageCode: string) { - this.languageCode = languageCode; + this.languageCode = "tam"; } getlanguageCode(): string { diff --git a/pmp-ui/src/app/features/resources/shared/dialog/dialog.component.html b/pmp-ui/src/app/features/resources/shared/dialog/dialog.component.html index 3f221ac18..d8d32f457 100644 --- a/pmp-ui/src/app/features/resources/shared/dialog/dialog.component.html +++ b/pmp-ui/src/app/features/resources/shared/dialog/dialog.component.html @@ -1,4 +1,5 @@ +

{{ "filters.titleTxt" | translate }}

@@ -223,3 +224,4 @@

{{ input.title }}

--> +
diff --git a/pmp-ui/src/app/features/resources/shared/dialog/dialog.component.ts b/pmp-ui/src/app/features/resources/shared/dialog/dialog.component.ts index 3f095ae2d..8e14f714c 100644 --- a/pmp-ui/src/app/features/resources/shared/dialog/dialog.component.ts +++ b/pmp-ui/src/app/features/resources/shared/dialog/dialog.component.ts @@ -46,7 +46,7 @@ export class DialogComponent implements OnInit { filterOptions: any = {}; primaryLangCode: string; - + sitealignment = 'ltr'; constructor( public dialog: MatDialog, public dialogRef: MatDialogRef, @@ -65,7 +65,9 @@ export class DialogComponent implements OnInit { async ngOnInit() { this.input = this.data; - console.log(this.input); + if(this.primaryLangCode === "ara"){ + this.sitealignment = 'rtl'; + } if (this.input.case === 'filter') { this.existingFilters = Utils.convertFilter( this.activatedRoute.snapshot.queryParams, diff --git a/pmp-ui/src/app/features/resources/shared/mater-data-common-body/mater-data-common-body.component.html b/pmp-ui/src/app/features/resources/shared/mater-data-common-body/mater-data-common-body.component.html index 448f5cd00..2aee5548d 100644 --- a/pmp-ui/src/app/features/resources/shared/mater-data-common-body/mater-data-common-body.component.html +++ b/pmp-ui/src/app/features/resources/shared/mater-data-common-body/mater-data-common-body.component.html @@ -1,5 +1,5 @@
- +

@@ -243,10 +243,10 @@ diff --git a/pmp-ui/src/app/features/resources/shared/mater-data-common-body/mater-data-common-body.component.ts b/pmp-ui/src/app/features/resources/shared/mater-data-common-body/mater-data-common-body.component.ts index a4c85523d..ef0622793 100644 --- a/pmp-ui/src/app/features/resources/shared/mater-data-common-body/mater-data-common-body.component.ts +++ b/pmp-ui/src/app/features/resources/shared/mater-data-common-body/mater-data-common-body.component.ts @@ -148,7 +148,7 @@ export class MaterDataCommonBodyComponent implements OnInit { setTimeout(()=>{ this.loadSecondaryForm(); }, 500); - + this.primaryLang = this.headerService.getlanguageCode(); this.translateService .getTranslation(this.primaryLang) .subscribe(response => { @@ -591,7 +591,7 @@ export class MaterDataCommonBodyComponent implements OnInit { this.primaryData["policies"] = JSON.stringify(this.primaryData["policies"]); } if (!response.errors || (response.errors.length == 0)) { - let url = this.pageName+" Updated Successfully"; + let url = this.pageName+" "+this.popupMessages.generickeys.updatedSuccessfully; this.showMessage(url) .afterClosed() .subscribe(() => { @@ -637,7 +637,7 @@ export class MaterDataCommonBodyComponent implements OnInit { this.primaryData["policies"] = JSON.stringify(this.primaryData["policies"]); } if (!response.errors || (response.errors.length == 0)) { - let url = this.pageName+" Created Successfully"; + let url = this.pageName+" "+this.popupMessages.generickeys.createdSuccessfully; this.showMessage(url) .afterClosed() .subscribe(() => { @@ -679,7 +679,7 @@ export class MaterDataCommonBodyComponent implements OnInit { case: 'MESSAGE', title: 'Success', message: message, - btnTxt: 'Ok' + btnTxt: this.popupMessages.generickeys.ok } }); return dialogRef; @@ -693,7 +693,7 @@ export class MaterDataCommonBodyComponent implements OnInit { case: 'MESSAGE', title: 'Error', message: message, - btnTxt: 'Ok' + btnTxt: this.popupMessages.generickeys.ok }, disableClose: true }); diff --git a/pmp-ui/src/app/shared/dialog/dialog.component.html b/pmp-ui/src/app/shared/dialog/dialog.component.html index a99fe48d1..cb5db1cdc 100644 --- a/pmp-ui/src/app/shared/dialog/dialog.component.html +++ b/pmp-ui/src/app/shared/dialog/dialog.component.html @@ -1,4 +1,5 @@ +

{{ "filters.titleTxt" | translate }}

@@ -138,25 +139,6 @@

{{ "filters.titleTxt" | translate }}

>
+
diff --git a/pmp-ui/src/app/shared/dialog/dialog.component.ts b/pmp-ui/src/app/shared/dialog/dialog.component.ts index 37e4e7f4e..c7012658f 100644 --- a/pmp-ui/src/app/shared/dialog/dialog.component.ts +++ b/pmp-ui/src/app/shared/dialog/dialog.component.ts @@ -50,6 +50,10 @@ export class DialogComponent implements OnInit { holidayForm: FormGroup; + sitealignment = 'ltr'; + + translateValue:any; + constructor( public dialog: MatDialog, public dialogRef: MatDialogRef, @@ -68,7 +72,15 @@ export class DialogComponent implements OnInit { async ngOnInit() { this.input = this.data; - console.log(this.input); + if(this.primaryLangCode === "ara"){ + this.sitealignment = 'rtl'; + } + this.translate + .getTranslation(this.primaryLangCode) + .subscribe(response => { + this.translateValue = response; + }); + if (this.input.case === 'filter') { this.existingFilters = Utils.convertFilter( this.activatedRoute.snapshot.queryParams, diff --git a/pmp-ui/src/assets/i18n/eng.json b/pmp-ui/src/assets/i18n/eng.json index c134bbaaa..eb9941ffd 100644 --- a/pmp-ui/src/assets/i18n/eng.json +++ b/pmp-ui/src/assets/i18n/eng.json @@ -465,6 +465,11 @@ "fieldValidation": "This field is required", "fieldNameValidation": " is required" }, + "generickeys":{ + "save":"Save", + "cancel":"Cancel", + "detailView":"Detail View" + }, "serverError": { "PMS_COR_001": "Missing Input Parameter", "PMS_PRT_002": " Policy group does not exist", diff --git a/pmp-ui/src/assets/i18n/kan.json b/pmp-ui/src/assets/i18n/kan.json index 8effb5c19..a4c33a4fe 100644 --- a/pmp-ui/src/assets/i18n/kan.json +++ b/pmp-ui/src/assets/i18n/kan.json @@ -460,6 +460,11 @@ "fieldValidation": "This field is required_kan", "fieldNameValidation": " is required_kan" }, + "generickeys":{ + "save":"Save_kan", + "cancel":"Cancel_kan", + "detailView":"Detail View_kan" + }, "serverError": { "PMS_COR_001": "ಇನ್‌ಪುಟ್ ಪ್ಯಾರಾಮೀಟರ್ ಕಾಣೆಯಾಗಿದೆ", "PMS_PRT_002": "ನೀತಿ ಗುಂಪು ಅಸ್ತಿತ್ವದಲ್ಲಿಲ್ಲ", diff --git a/pmp-ui/src/assets/i18n/tam.json b/pmp-ui/src/assets/i18n/tam.json index d7da5e1b2..17de79cb7 100644 --- a/pmp-ui/src/assets/i18n/tam.json +++ b/pmp-ui/src/assets/i18n/tam.json @@ -460,6 +460,16 @@ "fieldValidation": "This field is required_tam", "fieldNameValidation": " is required_tam" }, + "generickeys":{ + "save":"Save_tam", + "cancel":"Cancel_tam", + "detailView":"Detail View_tam", + "ok":"Ok_tam", + "updatedSuccessfully":"Updated Successfully_tam", + "createdSuccessfully":"Created Successfully_tam", + "success":"Success_tam", + "error":"Error_tam" + }, "serverError": { "PMS_COR_001": "உள்ளீட்டு அளவுரு இல்லை", "PMS_PRT_002": " கொள்கை குழு இல்லை", From 572ce3ce0d7bdc2d968b84a4448291cf40e71f09 Mon Sep 17 00:00:00 2001 From: Aravindhan Alagesan Date: Tue, 6 Feb 2024 14:59:29 +0530 Subject: [PATCH 2/2] Removed the hardcoded language code Signed-off-by: Aravindhan Alagesan --- pmp-ui/src/app/core/services/header.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pmp-ui/src/app/core/services/header.service.ts b/pmp-ui/src/app/core/services/header.service.ts index eab25de42..e64551b1f 100644 --- a/pmp-ui/src/app/core/services/header.service.ts +++ b/pmp-ui/src/app/core/services/header.service.ts @@ -95,7 +95,7 @@ export class HeaderService { } setlanguageCode(languageCode: string) { - this.languageCode = "tam"; + this.languageCode = languageCode; } getlanguageCode(): string {