From ac87c2b98b4b71aa0b9a471db0acbd7a57fb2a09 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lukas=20Mau=C3=9F?= <lukas.mauss@mni.thm.de>
Date: Fri, 8 Mar 2019 17:41:44 +0100
Subject: [PATCH] Add and fix i18n in statistic page

---
 .../shared/statistics-page/statistics-page.component.ts      | 5 +++--
 src/assets/i18n/creator/de.json                              | 3 ++-
 src/assets/i18n/creator/en.json                              | 3 ++-
 src/assets/i18n/participant/de.json                          | 3 ++-
 src/assets/i18n/participant/en.json                          | 3 ++-
 5 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/src/app/components/shared/statistics-page/statistics-page.component.ts b/src/app/components/shared/statistics-page/statistics-page.component.ts
index 9ae19ce39..a3d351e12 100644
--- a/src/app/components/shared/statistics-page/statistics-page.component.ts
+++ b/src/app/components/shared/statistics-page/statistics-page.component.ts
@@ -35,7 +35,6 @@ export class StatisticsPageComponent implements OnInit {
 
   ngOnInit(): void {
     if (sessionStorage.getItem('contentGroup')) {
-      console.log('in if');
       this.currentCG = sessionStorage.getItem('contentGroup');
     }
     this.getRoom(localStorage.getItem('roomId'));
@@ -55,7 +54,9 @@ export class StatisticsPageComponent implements OnInit {
           }
         }
       } else {
-        this.notificationService.show('No questions have been created yet!');
+        this.translateService.get('no-questions').subscribe( message => {
+          this.notificationService.show(message);
+        });
       }
       this.isLoading = false;
     });
diff --git a/src/assets/i18n/creator/de.json b/src/assets/i18n/creator/de.json
index e845fe6f2..6115e4586 100644
--- a/src/assets/i18n/creator/de.json
+++ b/src/assets/i18n/creator/de.json
@@ -69,6 +69,7 @@
     "answer-statistic": "Antwortstatistik",
     "answers": "Antworten",
     "percentage": "Prozent",
-    "abstentions": "Enthaltungen"
+    "abstentions": "Enthaltungen",
+    "no-questions": "Es sind noch keine Antworten vorhanden."
   }
 }
diff --git a/src/assets/i18n/creator/en.json b/src/assets/i18n/creator/en.json
index dd10fc18f..68d044bb8 100644
--- a/src/assets/i18n/creator/en.json
+++ b/src/assets/i18n/creator/en.json
@@ -69,6 +69,7 @@
     "answer-statistic": "Answer statistic",
     "answers": "Answers",
     "percentage": "Percentage",
-    "abstentions": "Abstentions"
+    "abstentions": "Abstentions",
+    "no-questions": "There are no answers yet."
   }
 }
diff --git a/src/assets/i18n/participant/de.json b/src/assets/i18n/participant/de.json
index 2b1bac626..d6e4ae5a0 100644
--- a/src/assets/i18n/participant/de.json
+++ b/src/assets/i18n/participant/de.json
@@ -34,6 +34,7 @@
     "answer-statistic": "Antwortstatistik",
     "answers": "Antworten",
     "percentage": "Prozent",
-    "abstentions": "Enthaltungen"
+    "abstentions": "Enthaltungen",
+    "no-questions": "Es sind noch keine Antworten vorhanden."
   }
 }
diff --git a/src/assets/i18n/participant/en.json b/src/assets/i18n/participant/en.json
index a82a698e3..9e6c65553 100644
--- a/src/assets/i18n/participant/en.json
+++ b/src/assets/i18n/participant/en.json
@@ -34,6 +34,7 @@
     "answer-statistic": "Answer statistic",
     "answers": "Answers",
     "percentage": "Percentage",
-    "abstentions": "Abstentions"
+    "abstentions": "Abstentions",
+    "no-questions": "There are no answers yet."
   }
 }
-- 
GitLab