From 25f0bc976ff15b68a7f310a185efc938deb43d0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elisabeth=20H=C3=B6lscher?= Date: Wed, 8 Mar 2023 19:35:35 +0100 Subject: [PATCH 1/5] Add missing translations to vue.js Frontend --- .../CreateContributionModalStepContentsStep5.vue | 8 ++++---- src/basicComponents/FirstModal.vue | 2 +- src/basicComponents/FooterElement.vue | 2 +- src/lang/de.json | 5 ++++- .../components/ContributionListFilterTermSelect.vue | 8 ++++---- src/pages/Schedule/components/ScheduleItem.vue | 9 ++++++--- 6 files changed, 20 insertions(+), 14 deletions(-) diff --git a/src/basicComponents/CreateContributionModalStepContentsStep5.vue b/src/basicComponents/CreateContributionModalStepContentsStep5.vue index c7c1878..00bcb07 100644 --- a/src/basicComponents/CreateContributionModalStepContentsStep5.vue +++ b/src/basicComponents/CreateContributionModalStepContentsStep5.vue @@ -159,7 +159,7 @@ export default {

- Beitragstitel + {{ $t('CreateContributionModal.StepContents.title') }}

- Beschreibung + {{ $t('CreateContributionModal.StepContents.text') }}

- Kategorie + {{ $t('CreateContributionModal.StepIndicator.category') }}

- Beitragstyp + {{ $t('CreateContributionModal.StepIndicator.type') }}

moment()) { cookieForbidsModal = true; } diff --git a/src/basicComponents/FooterElement.vue b/src/basicComponents/FooterElement.vue index 49e73c3..b104d49 100644 --- a/src/basicComponents/FooterElement.vue +++ b/src/basicComponents/FooterElement.vue @@ -81,7 +81,7 @@ export default { v-if="$route.meta.hasCreateButton && projectRunning && takesNewContributions" class="red angular" icon="add" - text="Beitrag erstellen" + :text="$t('ContributionList.addNew')" @click="$root.$emit('createContribution')" /> @@ -208,7 +208,7 @@ export default { @event click ok --> @@ -222,7 +222,7 @@ export default { @event click ok --> @@ -231,7 +231,7 @@ export default { @event click cancel --> diff --git a/src/pages/Schedule/components/ScheduleItem.vue b/src/pages/Schedule/components/ScheduleItem.vue index bef5eff..a234ba5 100644 --- a/src/pages/Schedule/components/ScheduleItem.vue +++ b/src/pages/Schedule/components/ScheduleItem.vue @@ -39,18 +39,21 @@ export default { * @returns {String} appointment date */ appointmentDate () { + // TODO time let appointmentDate = moment(this.appointment.start).format("DD.MM.YYYY - HH:mm"); if (this.appointment.end) { if (moment(this.appointment.start).get("day") === moment(this.appointment.end).get("day")) { - appointmentDate += " bis " + moment(this.appointment.end).format("HH:mm") + " Uhr"; + // TODO time + appointmentDate += " " + this.$t("Schedule.Item.until") + " " + moment(this.appointment.end).format("HH:mm") + " " + this.$t("Schedule.Item.oClock"); } else { - appointmentDate += " Uhr bis " + moment(this.appointment.end).format("DD.MM.YYYY - HH:mm") + " Uhr"; + // TODO time + appointmentDate += " " + this.$t("Schedule.Item.oClock") + " " + this.$t("Schedule.Item.until") + " " + moment(this.appointment.end).format("DD.MM.YYYY - HH:mm") + " " + this.$t("Schedule.Item.oClock"); } } else { - appointmentDate += " Uhr"; + appointmentDate += " " + this.$t("Schedule.Item.oClock"); } return appointmentDate; }, From 1ce9b35ee2f68fecf33067aa65d47a9912544934 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elisabeth=20H=C3=B6lscher?= Date: Wed, 8 Mar 2023 20:01:31 +0100 Subject: [PATCH 2/5] Comment out failing test !!! --- .../basicComponents/CreateContributionModal.test.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/vue_unittest/basicComponents/CreateContributionModal.test.js b/test/vue_unittest/basicComponents/CreateContributionModal.test.js index f407b28..3205e74 100644 --- a/test/vue_unittest/basicComponents/CreateContributionModal.test.js +++ b/test/vue_unittest/basicComponents/CreateContributionModal.test.js @@ -109,7 +109,8 @@ describe("CreateWizard", () => { }).$mount(); expect(CreateWizardExtend.stepvalue).to.be.an("object"); - expect(CreateWizardExtend.stepvalue).to.deep.equal({headline: "", text: ""}); + // TODO also fails in branch main 8.3.2023 + // expect(CreateWizardExtend.stepvalue).to.deep.equal({headline: "", text: ""}); expect(CreateWizardExtend.nextButtonDisabled).to.be.true; }); From a4d79a61f40da6658a2b13af73fb4d545e8df73a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elisabeth=20H=C3=B6lscher?= Date: Thu, 9 Mar 2023 12:05:19 +0100 Subject: [PATCH 3/5] Add datetime formats for translations --- src/lang/de.json | 17 +++++++++++++---- .../ContributionDetails/ContributionDetails.vue | 2 +- .../components/CommentsListComment.vue | 2 +- .../components/ContributionListTeaser.vue | 2 +- src/pages/Schedule/components/ScheduleItem.vue | 9 +++------ 5 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/lang/de.json b/src/lang/de.json index 69952a3..0036671 100644 --- a/src/lang/de.json +++ b/src/lang/de.json @@ -65,7 +65,9 @@ "loading": "Lade ...", "routeToEntry": "zum Beitrag", "comments": "{{teaserComments}} Kommentare", - "comment": "{{teaserComments}} Kommentar" + "comment": "{{teaserComments}} Kommentar", + "datetimeFormat": "DD.MM.YYYY | HH:mm", + "oClock": "Uhr" } }, "Contact": { @@ -126,7 +128,8 @@ "ContributionDetails": { "backToList": "Zurück zur Beitragsliste", "comment": "Kommentieren", - "oClock": "Uhr" + "oClock": "Uhr", + "datetimeFormat": "DD.MM.YYYY | HH:mm:ss" }, "ParagraphDivisionInPlanningSubareas": { "Filter": { @@ -178,7 +181,9 @@ "cancel": "Abbrechen", "reply": "Antworten", "replyNoPlural": "Antworten an Nr. ", - "replyNo": "Antwort an Nr. " + "replyNo": "Antwort an Nr. ", + "datetimeFormat": "DD.MM.YYYY | HH:mm:ss", + "oClock": "Uhr" } }, "RelatedContributions": { @@ -219,7 +224,11 @@ "Item": { "topic": "Thema:", "details": "Details", - "date": "Datum:" + "date": "Datum:", + "oClock": "Uhr", + "until": "bis", + "datetimeFormat": "DD.MM.YYYY - HH:mm", + "timeFormat": "HH:mm" } }, "MaintenanceMessage": { diff --git a/src/pages/ContributionDetails/ContributionDetails.vue b/src/pages/ContributionDetails/ContributionDetails.vue index e024978..8b57a59 100644 --- a/src/pages/ContributionDetails/ContributionDetails.vue +++ b/src/pages/ContributionDetails/ContributionDetails.vue @@ -47,7 +47,7 @@ export default { * @returns {String} date of the contribution creation */ created () { - return moment(this.contribution.created).format("DD.MM.YYYY | HH:mm:ss") + " " + this.$t("ContributionDetails.oClock"); + return moment(this.contribution.created).format(this.$t("ContributionDetails.datetimeFormat")) + " " + this.$t("ContributionDetails.oClock"); }, /** * serves the contribution category diff --git a/src/pages/ContributionDetails/components/CommentsListComment.vue b/src/pages/ContributionDetails/components/CommentsListComment.vue index 7e934f3..a4a79fe 100644 --- a/src/pages/ContributionDetails/components/CommentsListComment.vue +++ b/src/pages/ContributionDetails/components/CommentsListComment.vue @@ -71,7 +71,7 @@ export default { * @returns {String} */ created () { - return moment(this.comment.created).format("DD.MM.YYYY | HH:mm:ss") + " Uhr"; + return moment(this.comment.created).format(this.$t("CommentsList.Comment.datetimeFormat")) + " " + this.$t("CommentsList.Comment.oClock"); }, /** * serves the comments state is open as boolean diff --git a/src/pages/ContributionList/components/ContributionListTeaser.vue b/src/pages/ContributionList/components/ContributionListTeaser.vue index 167f547..ed68ffa 100644 --- a/src/pages/ContributionList/components/ContributionListTeaser.vue +++ b/src/pages/ContributionList/components/ContributionListTeaser.vue @@ -65,7 +65,7 @@ export default { * @returns {String} date and time when the teaser was created */ created () { - return moment(this.teaser.created).format("DD.MM.YYYY | HH:mm") + " Uhr"; + return moment(this.teaser.created).format(this.$t("ContributionList.ContributionListTeaser.datetimeFormat")) + " " + this.$t("ContributionList.ContributionListTeaser.oClock"); } } }; diff --git a/src/pages/Schedule/components/ScheduleItem.vue b/src/pages/Schedule/components/ScheduleItem.vue index a234ba5..bdb66e9 100644 --- a/src/pages/Schedule/components/ScheduleItem.vue +++ b/src/pages/Schedule/components/ScheduleItem.vue @@ -39,17 +39,14 @@ export default { * @returns {String} appointment date */ appointmentDate () { - // TODO time - let appointmentDate = moment(this.appointment.start).format("DD.MM.YYYY - HH:mm"); + let appointmentDate = moment(this.appointment.start).format(this.$t("Schedule.Item.datetimeFormat")); if (this.appointment.end) { if (moment(this.appointment.start).get("day") === moment(this.appointment.end).get("day")) { - // TODO time - appointmentDate += " " + this.$t("Schedule.Item.until") + " " + moment(this.appointment.end).format("HH:mm") + " " + this.$t("Schedule.Item.oClock"); + appointmentDate += " " + this.$t("Schedule.Item.until") + " " + moment(this.appointment.end).format(this.$t("Schedule.Item.timeFormat")) + " " + this.$t("Schedule.Item.oClock"); } else { - // TODO time - appointmentDate += " " + this.$t("Schedule.Item.oClock") + " " + this.$t("Schedule.Item.until") + " " + moment(this.appointment.end).format("DD.MM.YYYY - HH:mm") + " " + this.$t("Schedule.Item.oClock"); + appointmentDate += " " + this.$t("Schedule.Item.oClock") + " " + this.$t("Schedule.Item.until") + " " + moment(this.appointment.end).format(this.$t("Schedule.Item.datetimeFormat")) + " " + this.$t("Schedule.Item.oClock"); } } else { From 26b2d0918d3e43476ccb1541760ec4e81e012681 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elisabeth=20H=C3=B6lscher?= Date: Thu, 9 Mar 2023 12:18:02 +0100 Subject: [PATCH 4/5] Put the failing frontend test back in. --- .../basicComponents/CreateContributionModal.test.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/vue_unittest/basicComponents/CreateContributionModal.test.js b/test/vue_unittest/basicComponents/CreateContributionModal.test.js index 3205e74..f407b28 100644 --- a/test/vue_unittest/basicComponents/CreateContributionModal.test.js +++ b/test/vue_unittest/basicComponents/CreateContributionModal.test.js @@ -109,8 +109,7 @@ describe("CreateWizard", () => { }).$mount(); expect(CreateWizardExtend.stepvalue).to.be.an("object"); - // TODO also fails in branch main 8.3.2023 - // expect(CreateWizardExtend.stepvalue).to.deep.equal({headline: "", text: ""}); + expect(CreateWizardExtend.stepvalue).to.deep.equal({headline: "", text: ""}); expect(CreateWizardExtend.nextButtonDisabled).to.be.true; }); From 5219ae1a4b09ac5a90177216dbd000ef122516e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elisabeth=20H=C3=B6lscher?= Date: Thu, 9 Mar 2023 12:59:23 +0100 Subject: [PATCH 5/5] Update en.json --- src/lang/en.json | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/lang/en.json b/src/lang/en.json index fed5a20..bc2e2ba 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -12,7 +12,8 @@ "projectFinished": "The procedure is finished an ran until {{projectEnd}}.", "infoButton": "Get information", "startButton": "Start entry", - "conceptionsButton": "View conceptions" + "conceptionsButton": "View conceptions", + "minute": "Minute" }, "Cookiebar": { "title": "We use cookies!", @@ -62,7 +63,9 @@ "loading": "Loading ...", "routeToEntry": "To Entry", "comments": "{{teaserComments}} Comments", - "comment": "{{teaserComments}} Comment" + "comment": "{{teaserComments}} Comment", + "datetimeFormat": "DD/MM/YYYY | HH:mm", + "oClock": "o'clock" } }, "Contact": { @@ -123,7 +126,8 @@ "ContributionDetails": { "backToList": "Back to contribution list", "comment": "Comment", - "oClock": "o'clock" + "oClock": "o'clock", + "datetimeFormat": "DD/MM/YYYY | HH:mm:ss" }, "ParagraphDivisionInPlanningSubareas": { "Filter": { @@ -175,7 +179,9 @@ "cancel": "Cancel", "reply": "Reply", "replyNoPlural": "Reply for No. ", - "replyNo": "Reply for No. " + "replyNo": "Reply for No. ", + "datetimeFormat": "DD/MM/YYYY | HH:mm:ss", + "oClock": "o'clock" } }, "RelatedContributions": { @@ -216,7 +222,11 @@ "Item": { "topic": "Topic:", "details": "Details", - "date": "Date:" + "date": "Date:", + "oClock": "o'clock", + "until": "until", + "datetimeFormat": "DD/MM/YYYY - HH:mm", + "timeFormat": "HH:mm" } }, "MaintenanceMessage": {