From 3dc40e54005cd9a857e936d36c53acaa1e96acb8 Mon Sep 17 00:00:00 2001 From: mohammad <mohammad.alayoub@mni.thm.de> Date: Mon, 7 Jun 2021 14:18:17 +0200 Subject: [PATCH] add translations for messages after editing keywords --- .../topic-cloud-administration.component.ts | 14 +++++++------- src/assets/i18n/participant/de.json | 6 +++++- src/assets/i18n/participant/en.json | 6 +++++- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/src/app/components/shared/_dialogs/topic-cloud-administration/topic-cloud-administration.component.ts b/src/app/components/shared/_dialogs/topic-cloud-administration/topic-cloud-administration.component.ts index 9757c3dd4..f703bf7ff 100644 --- a/src/app/components/shared/_dialogs/topic-cloud-administration/topic-cloud-administration.component.ts +++ b/src/app/components/shared/_dialogs/topic-cloud-administration/topic-cloud-administration.component.ts @@ -197,7 +197,7 @@ export class TopicCloudAdministrationComponent implements OnInit, OnDestroy { keywords = comment.keywordsFromSpacy; keywords.splice(keywords.indexOf(key.keyword, 0), 1); changes.set('keywordsFromSpacy', JSON.stringify(keywords)); - this.updateComment(comment, changes); + this.updateComment(comment, changes, 'keyword-delete'); }); if (this.keywords.length === 0) { @@ -209,14 +209,14 @@ export class TopicCloudAdministrationComponent implements OnInit, OnDestroy { } } - updateComment(updatedComment: Comment, changes: TSMap<string, any>){ + updateComment(updatedComment: Comment, changes: TSMap<string, any>, messageTranslate: string){ this.commentService.patchComment(updatedComment, changes).subscribe(_ => { - this.translateService.get('topic-cloud.changes-successful').subscribe(msg => { + this.translateService.get('topic-cloud-dialog.' + messageTranslate).subscribe(msg => { this.notificationService.show(msg); }); }, error => { - this.translateService.get('topic-cloud.changes-gone-wrong').subscribe(msg => { + this.translateService.get('topic-cloud-dialog.changes-gone-wrong').subscribe(msg => { this.notificationService.show(msg); }); }); @@ -248,7 +248,7 @@ export class TopicCloudAdministrationComponent implements OnInit, OnDestroy { } } changes.set('keywordsFromSpacy', JSON.stringify(keywords)); - this.updateComment(comment, changes); + this.updateComment(comment, changes, 'keyword-edit'); }); } @@ -288,8 +288,8 @@ export class TopicCloudAdministrationComponent implements OnInit, OnDestroy { mergeKeywords(key1: Keyword, key2: Keyword) { if (key1 !== undefined && key2 !== undefined){ - key1.comments.map(question => { - key2.comments.push(question); + key1.comments.map(comment => { + key2.comments.push(comment); }); this.deleteKeyword(key1); } diff --git a/src/assets/i18n/participant/de.json b/src/assets/i18n/participant/de.json index 38e15dac7..ee93d69a1 100644 --- a/src/assets/i18n/participant/de.json +++ b/src/assets/i18n/participant/de.json @@ -263,7 +263,11 @@ "show-blacklist": "Zeige Blackliste", "hide-blacklist": "Verberge Blackliste", "show-profanity-list": "Zeige Schimpfwortliste", - "hide-profanity-list": "Verberge Schimpfwortliste" + "hide-profanity-list": "Verberge Schimpfwortliste", + "keyword-delete": "Stichwort gelöscht", + "keyword-edit": "Stichwort umbenannt", + "keywords-merge": "Stichwörter zusammengefügt", + "changes-gone-wrong": "etwas ist schiefgelaufen" }, "topic-cloud-confirm-dialog": { "cancel": "Abbrechen", diff --git a/src/assets/i18n/participant/en.json b/src/assets/i18n/participant/en.json index 4e481147a..29ed8cf0b 100644 --- a/src/assets/i18n/participant/en.json +++ b/src/assets/i18n/participant/en.json @@ -268,7 +268,11 @@ "show-blacklist": "Show blacklist", "hide-blacklist": "Hide blacklist", "show-profanity-list": "Show profanity list", - "hide-profanity-list": "Hide profanity list" + "hide-profanity-list": "Hide profanity list", + "keyword-delete": "keyword deleted", + "keyword-edit": "keyword renamed", + "keywords-merge": "keywords merged", + "changes-gone-wrong": "somthing gone wrong" }, "topic-cloud-confirm-dialog":{ "cancel": "Cancel", -- GitLab