diff --git a/frontend/src/i18n/lang/en.json b/frontend/src/i18n/lang/en.json index 1e883abec..9250b07d9 100644 --- a/frontend/src/i18n/lang/en.json +++ b/frontend/src/i18n/lang/en.json @@ -582,23 +582,7 @@ "import": "Import Tasks", "untitled": "Untitled Task", "completed": "Completed", - "dueDate": "Due", - "priority": "Priority", - "project": "Project", - "labels": "Labels", - "attributes": { - "title": "Title", - "description": "Description", - "due_date": "Due Date", - "start_date": "Start Date", - "end_date": "End Date", - "done": "Done/Completed", - "priority": "Priority", - "labels": "Labels/Tags", - "project": "Project", - "reminder": "Reminder", - "ignore": "Ignore" - } + "ignore": "Ignore" } }, "label": { diff --git a/frontend/src/views/migrate/MigrationCSV.vue b/frontend/src/views/migrate/MigrationCSV.vue index 5d7c738a1..31485dc12 100644 --- a/frontend/src/views/migrate/MigrationCSV.vue +++ b/frontend/src/views/migrate/MigrationCSV.vue @@ -108,7 +108,7 @@ :key="attr.value" :value="attr.value" > - {{ $t('migrate.csv.attributes.' + attr.value) }} + {{ getAttributeLabel(attr.value) }} @@ -153,16 +153,16 @@
- {{ $t('migrate.csv.dueDate') }}: {{ task.due_date }} + {{ $t('task.attributes.dueDate') }}: {{ task.due_date }} - {{ $t('migrate.csv.priority') }}: {{ task.priority }} + {{ $t('task.attributes.priority') }}: {{ task.priority }} - {{ $t('migrate.csv.project') }}: {{ task.project }} + {{ $t('project.title') }}: {{ task.project }} - {{ $t('migrate.csv.labels') }}: {{ task.labels.join(', ') }} + {{ $t('task.attributes.labels') }}: {{ task.labels.join(', ') }}
@@ -251,6 +251,24 @@ const hasValidMapping = computed(() => { return config.value.mapping.some(m => m.attribute === 'title') }) +// Map snake_case attribute names to translation keys +function getAttributeLabel(attribute: string): string { + const attributeMap: Record = { + title: 'task.attributes.title', + description: 'task.attributes.description', + due_date: 'task.attributes.dueDate', + start_date: 'task.attributes.startDate', + end_date: 'task.attributes.endDate', + done: 'task.attributes.done', + priority: 'task.attributes.priority', + labels: 'task.attributes.labels', + reminder: 'task.attributes.reminders', + project: 'project.title', + ignore: 'migrate.csv.ignore', + } + return t(attributeMap[attribute] || attribute) +} + function truncate(text: string, length: number): string { if (text.length <= length) return text return text.substring(0, length) + '...'