From 81b1227e826239774d5672c140607a5c66458dd7 Mon Sep 17 00:00:00 2001 From: Denis Lugowski Date: Fri, 21 Nov 2025 19:20:19 +0100 Subject: [PATCH 1/2] 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') }} diff --git a/legalconsenthub/i18n/locales/de.json b/legalconsenthub/i18n/locales/de.json index e575e66..730c569 100644 --- a/legalconsenthub/i18n/locales/de.json +++ b/legalconsenthub/i18n/locales/de.json @@ -6,7 +6,7 @@ "noPermission": "Keine Berechtigung", "noPermissionDescription": "Sie haben keine Berechtigung zum Erstellen von Anträgen.", "backToOverview": "Zurück zur Übersicht", - "deleteConfirm": "Möchten Sie wirklich den Mitbestimmungsantrag {name} löschen?", + "deleteConfirm": "Möchten Sie wirklich den Mitbestimmungsantrag \"{name}\" löschen?", "deleteTitle": "Mitbestimmungsantrag löschen", "lastEditedBy": "Zuletzt bearbeitet von", "createdBy": "Erstellt von", @@ -102,16 +102,28 @@ "accessDenied": "Zugriff verweigert" }, "user": { - "profile": "Profil", "administration": "Administration", "settings": "Einstellungen", - "logout": "Abmelden", - "theme": "Design", - "themePrimary": "Primärfarbe", - "themeNeutral": "Neutralfarbe", - "appearance": "Erscheinungsbild", - "light": "Hell", - "dark": "Dunkel" + "logout": "Abmelden" + }, + "settings": { + "title": "Einstellungen", + "language": { + "title": "Sprache", + "description": "Wählen Sie Ihre bevorzugte Sprache" + }, + "appearance": { + "title": "Erscheinungsbild", + "description": "Wählen Sie zwischen hellem und dunklem Modus", + "light": "Hell", + "dark": "Dunkel" + }, + "theme": { + "title": "Farbschema", + "description": "Passen Sie die Farben der Anwendung an", + "primary": "Primärfarbe", + "neutral": "Neutralfarbe" + } }, "organization": { "current": "Aktuelle Organisation" diff --git a/legalconsenthub/i18n/locales/en.json b/legalconsenthub/i18n/locales/en.json index 80389c6..15dd78d 100644 --- a/legalconsenthub/i18n/locales/en.json +++ b/legalconsenthub/i18n/locales/en.json @@ -6,7 +6,7 @@ "noPermission": "No Permission", "noPermissionDescription": "You do not have permission to create applications.", "backToOverview": "Back to Overview", - "deleteConfirm": "Do you really want to delete the co-determination application {name}?", + "deleteConfirm": "Do you really want to delete the co-determination application \"{name}\"?", "deleteTitle": "Delete Co-determination Application", "lastEditedBy": "Last edited by", "createdBy": "Created by", @@ -102,16 +102,28 @@ "accessDenied": "Access denied" }, "user": { - "profile": "Profile", "administration": "Administration", "settings": "Settings", - "logout": "Log out", - "theme": "Theme", - "themePrimary": "Primary Color", - "themeNeutral": "Neutral Color", - "appearance": "Appearance", - "light": "Light", - "dark": "Dark" + "logout": "Log out" + }, + "settings": { + "title": "Settings", + "language": { + "title": "Language", + "description": "Choose your preferred language" + }, + "appearance": { + "title": "Appearance", + "description": "Choose between light and dark mode", + "light": "Light", + "dark": "Dark" + }, + "theme": { + "title": "Color Theme", + "description": "Customize the application colors", + "primary": "Primary Color", + "neutral": "Neutral Color" + } }, "organization": { "current": "Current Organization" diff --git a/legalconsenthub/nuxt.config.ts b/legalconsenthub/nuxt.config.ts index 176bce4..b7b17fe 100644 --- a/legalconsenthub/nuxt.config.ts +++ b/legalconsenthub/nuxt.config.ts @@ -28,6 +28,7 @@ export default defineNuxtConfig({ ], i18n: { defaultLocale: 'de', + strategy: 'no_prefix', locales: [ { code: 'en', name: 'English', file: 'en.json' }, { code: 'de', name: 'Deutsch', file: 'de.json' }