From 68aeeb54f4c8ea7fe73b2a7af7e6da68e59b50d6 Mon Sep 17 00:00:00 2001 From: Gabriele Panico Date: Tue, 5 Dec 2023 15:10:31 +0100 Subject: [PATCH] translations added --- .../cds-chatbot-details.component.html | 3 ++- .../cds-chatbot-details.component.ts | 13 ++++++++++--- .../community/community.component.ts | 4 ++-- .../cds-chatbot-details/detail/detail.component.ts | 4 ++-- .../import-export/import-export.component.ts | 7 ++++--- .../cds-header/cds-header.component.ts | 1 - .../cds-publish-on-community-modal.component.ts | 4 +++- src/assets/i18n/en.json | 2 ++ 8 files changed, 25 insertions(+), 13 deletions(-) diff --git a/src/app/chatbot-design-studio/cds-chatbot-details/cds-chatbot-details.component.html b/src/app/chatbot-design-studio/cds-chatbot-details/cds-chatbot-details.component.html index 66a7495b..4a12abce 100644 --- a/src/app/chatbot-design-studio/cds-chatbot-details/cds-chatbot-details.component.html +++ b/src/app/chatbot-design-studio/cds-chatbot-details/cds-chatbot-details.component.html @@ -41,7 +41,8 @@ + [faqKb_name]="faqKb_name" + [translationsMap]="translationsMap"> { this.translationsMap.set('CDSSetting.UpdateBotError', text['CDSSetting.UpdateBotError']) .set('CDSSetting.UpdateBotSuccess', text['CDSSetting.UpdateBotSuccess']) - .set('CDSSetting.Not a valid JSON file.', text['CDSSetting.Not a valid JSON file.']) + .set('CDSSetting.NotAValidJSON', text['CDSSetting.NotAValidJSON']) .set('CDSSetting.AnErrorOccurredWhilDeletingTheAnswer', text['CDSSetting.AnErrorOccurredWhilDeletingTheAnswer']) .set('CDSSetting.AnswerSuccessfullyDeleted', text['CDSSetting.AnswerSuccessfullyDeleted']) .set('Done', text['Done']) .set('CDSSetting.ThereHasBeenAnErrorProcessing', text['CDSSetting.ThereHasBeenAnErrorProcessing']) + .set('CDSSetting.FileUploadedSuccessfully', text['CDSSetting.FileUploadedSuccessfully']) + .set('CDSSetting.ThereHasBeenAnErrorProcessing', text['CDSSetting.AnErrorOccurredUpdatingProfile']) + .set('CDSSetting.ThereHasBeenAnErrorProcessing', text['CDSSetting.UserProfileUpdated']) }) diff --git a/src/app/chatbot-design-studio/cds-chatbot-details/community/community.component.ts b/src/app/chatbot-design-studio/cds-chatbot-details/community/community.component.ts index 521fc544..b83a4a8a 100644 --- a/src/app/chatbot-design-studio/cds-chatbot-details/community/community.component.ts +++ b/src/app/chatbot-design-studio/cds-chatbot-details/community/community.component.ts @@ -377,12 +377,12 @@ export class CDSDetailCommunityComponent implements OnInit { }, (error) => { this.logger.error('[CDS-DETAIL-COMMUNITY] UPDATE USER PROFILE - ERROR ', error); // =========== NOTIFY ERROR =========== - this.notify.showWidgetStyleUpdateNotification('An error occurred while updating your user profile', 4, 'report_problem'); + this.notify.showWidgetStyleUpdateNotification(this.translationsMap.get('CDSSetting.AnErrorOccurredUpdatingProfile'), 4, 'report_problem'); }, () => { this.logger.log('[CDS-CHATBOT-DTLS] UPDATE USER PROFILE - * COMPLETE *'); // =========== NOTIFY SUCCESS=========== - this.notify.showWidgetStyleUpdateNotification('User profile updated successfully', 2, 'done'); + this.notify.showWidgetStyleUpdateNotification(this.translationsMap.get('CDSSetting.UserProfileUpdated'), 2, 'done'); }) diff --git a/src/app/chatbot-design-studio/cds-chatbot-details/detail/detail.component.ts b/src/app/chatbot-design-studio/cds-chatbot-details/detail/detail.component.ts index fd35571a..3d140ee3 100644 --- a/src/app/chatbot-design-studio/cds-chatbot-details/detail/detail.component.ts +++ b/src/app/chatbot-design-studio/cds-chatbot-details/detail/detail.component.ts @@ -566,12 +566,12 @@ export class CDSDetailBotDetailComponent extends BotsBaseComponent implements On // =========== NOTIFY ERROR =========== - this.notify.showWidgetStyleUpdateNotification(this.translationsMap.get('UpdateBotError'), 4, 'report_problem'); + this.notify.showWidgetStyleUpdateNotification(this.translationsMap.get('CDSSetting.UpdateBotError'), 4, 'report_problem'); }, () => { this.logger.log('[CDS-CHATBOT-DTLS] EDIT BOT LANG - * COMPLETE *'); // =========== NOTIFY SUCCESS=========== - this.notify.showWidgetStyleUpdateNotification(this.translationsMap.get('UpdateBotSuccess'), 2, 'done'); + this.notify.showWidgetStyleUpdateNotification(this.translationsMap.get('CDSSetting.UpdateBotSuccess'), 2, 'done'); this.updateChatbot(this.selectedChatbot, langCode) }); diff --git a/src/app/chatbot-design-studio/cds-chatbot-details/import-export/import-export.component.ts b/src/app/chatbot-design-studio/cds-chatbot-details/import-export/import-export.component.ts index aad57c86..b4994c1e 100644 --- a/src/app/chatbot-design-studio/cds-chatbot-details/import-export/import-export.component.ts +++ b/src/app/chatbot-design-studio/cds-chatbot-details/import-export/import-export.component.ts @@ -14,6 +14,7 @@ export class CDSDetailImportExportComponent implements OnInit { @Input() id_faq_kb: string; @Input() faqKb_name: string; + @Input() translationsMap: Map = new Map(); displayImportModal = 'none'; displayInfoModal = 'none'; @@ -111,7 +112,7 @@ export class CDSDetailImportExportComponent implements OnInit { }, (error) => { this.logger.error('[TILEBOT] - IMPORT CHATBOT FROM JSON- ERROR', error); - this.notify.showWidgetStyleUpdateNotification("CDSSetting.ThereHasBeenAnErrorProcessing", 4, 'report_problem'); + this.notify.showWidgetStyleUpdateNotification(this.translationsMap.get('CDSSetting.ThereHasBeenAnErrorProcessing'), 4, 'report_problem'); }, () => { this.logger.log('[TILEBOT] - IMPORT CHATBOT FROM JSON - COMPLETE'); }); @@ -145,10 +146,10 @@ export class CDSDetailImportExportComponent implements OnInit { }, (error) => { this.logger.error('[TILEBOT] - IMPORT INTENTS FROM JSON- ERROR', error); - this.notify.showWidgetStyleUpdateNotification("CDSSetting.ThereHasBeenAnErrorProcessing", 4, 'report_problem'); + this.notify.showWidgetStyleUpdateNotification(this.translationsMap.get('CDSSetting.ThereHasBeenAnErrorProcessing'), 4, 'report_problem'); }, () => { this.logger.log('[TILEBOT] - IMPORT INTENTS FROM JSON - * COMPLETE *'); - this.notify.showWidgetStyleUpdateNotification("CDSSetting.FileUploadedSuccessfully", 2, 'done'); + this.notify.showWidgetStyleUpdateNotification(this.translationsMap.get('CDSSetting.FileUploadedSuccessfully'), 2, 'done'); this.onCloseImportJSONModal(); diff --git a/src/app/chatbot-design-studio/cds-dashboard/cds-header/cds-header.component.ts b/src/app/chatbot-design-studio/cds-dashboard/cds-header/cds-header.component.ts index 6722c4d1..1ccbd1e5 100644 --- a/src/app/chatbot-design-studio/cds-dashboard/cds-header/cds-header.component.ts +++ b/src/app/chatbot-design-studio/cds-dashboard/cds-header/cds-header.component.ts @@ -3,7 +3,6 @@ import { Router } from '@angular/router'; import { MatDialog } from '@angular/material/dialog'; -import { NotifyService } from 'src/app/services/notify.service'; import { MultichannelService } from 'src/app/services/multichannel.service'; import { AppConfigService } from 'src/app/services/app-config'; import { FaqKbService } from 'src/app/services/faq-kb.service'; diff --git a/src/app/modals/cds-publish-on-community-modal/cds-publish-on-community-modal.component.ts b/src/app/modals/cds-publish-on-community-modal/cds-publish-on-community-modal.component.ts index c635a23e..f5b2d7a5 100644 --- a/src/app/modals/cds-publish-on-community-modal/cds-publish-on-community-modal.component.ts +++ b/src/app/modals/cds-publish-on-community-modal/cds-publish-on-community-modal.component.ts @@ -9,6 +9,7 @@ import { AppConfigService } from 'src/app/services/app-config'; import { LoggerService } from 'src/chat21-core/providers/abstract/logger.service'; import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance'; import { UploadService } from 'src/chat21-core/providers/abstract/upload.service'; +import { TranslateService } from '@ngx-translate/core'; @Component({ selector: 'appdashboard-cds-publish-on-community-modal', @@ -49,6 +50,7 @@ export class CdsPublishOnCommunityModalComponent implements OnInit { private uploadService: UploadService, private sanitizer: DomSanitizer, private notify: NotifyService, + private translate: TranslateService, ) { this.logger.log('[PUBLISH-ON-COMMUNITY-MODAL-COMPONENT] data ', data) this.selectedChatbot = data.chatbot; @@ -292,7 +294,7 @@ export class CdsPublishOnCommunityModalComponent implements OnInit { }, () => { this.logger.log('[PUBLISH-ON-COMMUNITY-MODAL-COMPONENT] publishOnCommunity * COMPLETE * '); - this.notify.showWidgetStyleUpdateNotification('CDSSetting.SuccessfullyDeployed', 2, 'done'); + this.notify.showWidgetStyleUpdateNotification(this.translate.instant('CDSSetting.SuccessfullyDeployed'), 2, 'done'); this.dialogRef.close('has-published-on-cmnty'); }); diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json index b69f4694..aeafcb9a 100644 --- a/src/assets/i18n/en.json +++ b/src/assets/i18n/en.json @@ -178,6 +178,8 @@ "AnErrorOccurredDuringTheUpload": "An error occurred during the upload", "InTheCSVFileToBeUploadedTheColumnsAreSeparatedBy": "In the CSV file to be uploaded, the columns are separated by", "UpdateBotError": "An error occurred while updating the bot", + "UserProfileUpdated":"User profile updated successfully", + "AnErrorOccurredUpdatingProfile":"An error occurred while updating your user profile", "Not a valid JSON file.": "Not a valid JSON file", "UpdateBotSuccess": " bot successfully updated", "AnErrorOccurredWhilDeletingTheAnswer": "An error occurred while deleting the Answer",