From 81b1227e826239774d5672c140607a5c66458dd7 Mon Sep 17 00:00:00 2001 From: Denis Lugowski Date: Fri, 21 Nov 2025 19:20:19 +0100 Subject: [PATCH] feat(#22): Use translation keys in files --- .../app/components/DeleteModal.vue | 8 +- legalconsenthub/app/components/FormEngine.vue | 5 +- .../components/FormStepperWithNavigation.vue | 8 +- .../components/FormValidationIndicator.vue | 57 +++---- .../app/components/NotificationsSlideover.vue | 4 +- .../app/components/RestoreVersionModal.vue | 11 +- legalconsenthub/app/components/TheComment.vue | 11 +- legalconsenthub/app/components/UserMenu.vue | 22 +-- .../app/components/VersionComparisonModal.vue | 34 ++-- .../app/components/VersionHistory.vue | 35 ++-- .../app/components/formelements/TheSelect.vue | 2 +- .../formelements/TheTitleBodyInput.vue | 4 +- .../components/formelements/Unimplemented.vue | 2 +- .../composables/useFormElementManagement.ts | 7 +- .../app/composables/usePermissions.ts | 1 - legalconsenthub/app/error.vue | 6 +- legalconsenthub/app/layouts/default.vue | 6 +- .../app/middleware/permissions.global.ts | 1 - legalconsenthub/app/pages/administration.vue | 37 +++-- .../application-forms/[id]/[sectionIndex].vue | 9 +- .../pages/application-forms/[id]/versions.vue | 14 +- legalconsenthub/app/pages/create.vue | 15 +- legalconsenthub/app/pages/index.vue | 19 ++- legalconsenthub/app/pages/login.vue | 53 +++--- legalconsenthub/app/utils/formDiff.ts | 6 +- legalconsenthub/i18n/locales/de.json | 157 +++++++++++++++++- legalconsenthub/i18n/locales/en.json | 157 +++++++++++++++++- legalconsenthub/types/formDiff.ts | 1 - 28 files changed, 497 insertions(+), 195 deletions(-) diff --git a/legalconsenthub/app/components/DeleteModal.vue b/legalconsenthub/app/components/DeleteModal.vue index c89519a..29594fb 100644 --- a/legalconsenthub/app/components/DeleteModal.vue +++ b/legalconsenthub/app/components/DeleteModal.vue @@ -1,11 +1,11 @@ diff --git a/legalconsenthub/app/components/FormEngine.vue b/legalconsenthub/app/components/FormEngine.vue index 60f21d1..56643e2 100644 --- a/legalconsenthub/app/components/FormEngine.vue +++ b/legalconsenthub/app/components/FormEngine.vue @@ -92,18 +92,19 @@ function getResolvedComponent(formElement: FormElementDto) { } function getDropdownItems(formElementId: string, formElementPosition: number): DropdownMenuItem[] { + const { t: $t } = useI18n() const items = [] if (route.path !== '/create') { items.push({ - label: 'Comments', + label: $t('applicationForms.formElements.comments'), icon: 'i-lucide-message-square-more', onClick: () => toggleComments(formElementId) }) } items.push({ - label: 'Add input field below', + label: $t('applicationForms.formElements.addInputBelow'), icon: 'i-lucide-list-plus', onClick: () => emit('add:input-form', formElementPosition) }) diff --git a/legalconsenthub/app/components/FormStepperWithNavigation.vue b/legalconsenthub/app/components/FormStepperWithNavigation.vue index b6f31f4..bb88aea 100644 --- a/legalconsenthub/app/components/FormStepperWithNavigation.vue +++ b/legalconsenthub/app/components/FormStepperWithNavigation.vue @@ -30,7 +30,7 @@
- Prev + {{ $t('applicationForms.navigation.previous') }} - Next + {{ $t('applicationForms.navigation.next') }}
- Save + {{ $t('applicationForms.navigation.save') }} - Submit + {{ $t('applicationForms.navigation.submit') }}
diff --git a/legalconsenthub/app/components/FormValidationIndicator.vue b/legalconsenthub/app/components/FormValidationIndicator.vue index 19d865b..59cb023 100644 --- a/legalconsenthub/app/components/FormValidationIndicator.vue +++ b/legalconsenthub/app/components/FormValidationIndicator.vue @@ -1,13 +1,7 @@ @@ -75,16 +58,18 @@ const shieldIcon = computed(() => { } }) +const { t: $t } = useI18n() + const statusLabel = computed(() => { switch (props.status) { case ComplianceStatus.Critical: - return 'Kritisch' + return $t('compliance.critical') case ComplianceStatus.Warning: - return 'Warnung' + return $t('compliance.warning') case ComplianceStatus.NonCritical: - return 'Unkritisch' + return $t('compliance.nonCritical') default: - return 'Unkritisch' + return $t('compliance.nonCritical') } }) @@ -144,15 +129,18 @@ const progressOffset = computed(() => { return circumference - (progressValue.value / 100) * circumference }) -watch(() => props.status, () => { - const element = document.querySelector('.shield-ring') - if (element) { - element.classList.add('status-change-pulse') - setTimeout(() => { - element.classList.remove('status-change-pulse') - }, 600) +watch( + () => props.status, + () => { + const element = document.querySelector('.shield-ring') + if (element) { + element.classList.add('status-change-pulse') + setTimeout(() => { + element.classList.remove('status-change-pulse') + }, 600) + } } -}) +) - diff --git a/legalconsenthub/app/components/NotificationsSlideover.vue b/legalconsenthub/app/components/NotificationsSlideover.vue index a7e501f..f98e0a7 100644 --- a/legalconsenthub/app/components/NotificationsSlideover.vue +++ b/legalconsenthub/app/components/NotificationsSlideover.vue @@ -1,9 +1,9 @@ - Submit - Edit comment - Cancel + + {{ $t('comments.submit') }} + + {{ $t('comments.edit') }} + {{ $t('common.cancel') }}