Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions src/app/src/components/shared/item/ItemActionsDropdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ watch(context.actionInProgress, (actionInProgress) => {
}
})

const getActionLabel = (action: StudioAction<StudioItemActionId>) => {
return t(`studio.actions.labels.${action.id}`, action.label || action.id)
}

const getPendingActionLabel = (action: StudioAction<StudioItemActionId> | null) => {
if (!action) return ''
const verb = action.id.split('-')[0]
Expand All @@ -68,7 +64,7 @@ const actions = computed<DropdownMenuItem[]>(() => {

return {
...action,
label: isPending ? getPendingActionLabel(pendingAction.value) : getActionLabel(action),
label: isPending ? getPendingActionLabel(pendingAction.value) : t(action.label),
icon,
color: isPending ? (isDeleteAction ? 'error' : 'secondary') : 'neutral',
slot: isPending ? 'pending-action' : undefined,
Expand Down
2 changes: 1 addition & 1 deletion src/app/src/components/shared/item/ItemActionsToolbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const getActionTooltip = (action: StudioAction<StudioItemActionId>, isPending: b
const verb = action.id.split('-')[0]
return t('studio.actions.confirmAction', { action: t(`studio.actions.verbs.${verb}`, verb) })
}
return action.tooltip ? t(action.tooltip, action.tooltip) : t(`studio.actions.labels.${action.id}`, action.id)
return action.tooltip ? t(action.tooltip) : t(action.label)
}

const actions = computed(() => {
Expand Down
2 changes: 1 addition & 1 deletion src/app/src/components/shared/item/ItemCardForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ const tooltipText = computed(() => {
if (validationErrors.value.length > 0) {
return validationErrors.value[0]?.message
}
return t(`studio.actions.labels.${props.actionId}`)
return t(action.value.label)
})

const handleClickOutside = (event: MouseEvent) => {
Expand Down
36 changes: 18 additions & 18 deletions src/app/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,26 +118,26 @@
"duplicate": "duplicate"
},
"labels": {
"create-document": "New file",
"create-document-folder": "New folder",
"create-media-folder": "New media folder",
"rename-item": "Rename",
"delete-item": "Delete",
"upload-media": "Upload media",
"duplicate-item": "Duplicate",
"revert-item": "Revert changes",
"publish-branch": "Publish branch"
"createDocument": "New file",
"createDocumentFolder": "New folder",
"createMediaFolder": "New media folder",
"renameItem": "Rename",
"deleteItem": "Delete",
"uploadMedia": "Upload media",
"duplicateItem": "Duplicate",
"revertItem": "Revert changes",
"publishBranch": "Publish branch"
},
"tooltips": {
"revert-item": "Revert changes",
"create-document": "Create a new file",
"upload-media": "Upload media",
"create-document-folder": "Create a new folder",
"create-media-folder": "Create a new folder",
"rename-item": "Rename file",
"duplicate-item": "Duplicate file",
"delete-item": "Delete file",
"publish-branch": "Publish branch"
"createDocument": "Create a new file",
"createDocumentFolder": "Create a new folder",
"createMediaFolder": "Create a new folder",
"renameItem": "Rename file",
"deleteItem": "Delete file",
"uploadMedia": "Upload media",
"duplicateItem": "Duplicate file",
"revertItem": "Revert changes",
"publishBranch": "Publish branch"
}
},
"items": {
Expand Down
36 changes: 18 additions & 18 deletions src/app/src/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,26 +118,26 @@
"duplicate": "dupliquer"
},
"labels": {
"create-document": "Nouveau fichier",
"create-document-folder": "Nouveau dossier",
"create-media-folder": "Nouveau dossier média",
"rename-item": "Renommer",
"delete-item": "Supprimer",
"upload-media": "Téléverser un média",
"duplicate-item": "Dupliquer",
"revert-item": "Annuler les modifications",
"publish-branch": "Publier la branche"
"createDocument": "Nouveau fichier",
"createDocumentFolder": "Nouveau dossier",
"createMediaFolder": "Nouveau dossier média",
"renameItem": "Renommer",
"deleteItem": "Supprimer",
"uploadMedia": "Téléverser un média",
"duplicateItem": "Dupliquer",
"revertItem": "Annuler les changements",
"publishBranch": "Publier la branche"
},
"tooltips": {
"revert-item": "Annuler les modifications",
"create-document": "Créer un nouveau fichier",
"upload-media": "Téléverser un média",
"create-document-folder": "Créer un nouveau dossier",
"create-media-folder": "Créer un nouveau dossier",
"rename-item": "Renommer le fichier",
"duplicate-item": "Dupliquer le fichier",
"delete-item": "Supprimer le fichier",
"publish-branch": "Publier la branche"
"createDocument": "Créer un nouveau fichier",
"createDocumentFolder": "Créer un nouveau dossier",
"createMediaFolder": "Créer un nouveau dossier média",
"renameItem": "Renommer le fichier",
"deleteItem": "Supprimer le fichier",
"uploadMedia": "Téléverser un média",
"duplicateItem": "Dupliquer le fichier",
"revertItem": "Annuler les modifications",
"publishBranch": "Publier la branche"
}
},
"items": {
Expand Down
36 changes: 18 additions & 18 deletions src/app/src/utils/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,59 +6,59 @@ export const twoStepActions: StudioItemActionId[] = [StudioItemActionId.CreateDo
export const STUDIO_ITEM_ACTION_DEFINITIONS: StudioAction<StudioItemActionId>[] = [
{
id: StudioItemActionId.RevertItem,
label: 'studio.actions.labels.revert-item',
label: 'studio.actions.labels.revertItem',
icon: 'i-lucide-undo',
tooltip: 'studio.actions.tooltips.revert-item',
tooltip: 'studio.actions.tooltips.revertItem',
},
{
id: StudioItemActionId.CreateDocument,
label: 'studio.actions.labels.create-document',
label: 'studio.actions.labels.createDocument',
icon: 'i-lucide-file-plus',
tooltip: 'studio.actions.tooltips.create-document',
tooltip: 'studio.actions.tooltips.createDocument',
},
{
id: StudioItemActionId.UploadMedia,
label: 'studio.actions.labels.upload-media',
label: 'studio.actions.labels.uploadMedia',
icon: 'i-lucide-upload',
tooltip: 'studio.actions.tooltips.upload-media',
tooltip: 'studio.actions.tooltips.uploadMedia',
},
{
id: StudioItemActionId.CreateDocumentFolder,
label: 'studio.actions.labels.create-document-folder',
label: 'studio.actions.labels.createDocumentFolder',
icon: 'i-lucide-folder-plus',
tooltip: 'studio.actions.tooltips.create-document-folder',
tooltip: 'studio.actions.tooltips.createDocumentFolder',
},
{
id: StudioItemActionId.CreateMediaFolder,
label: 'studio.actions.labels.create-media-folder',
label: 'studio.actions.labels.createMediaFolder',
icon: 'i-lucide-folder-plus',
tooltip: 'studio.actions.tooltips.create-media-folder',
tooltip: 'studio.actions.tooltips.createMediaFolder',
},
{
id: StudioItemActionId.RenameItem,
label: 'studio.actions.labels.rename-item',
label: 'studio.actions.labels.renameItem',
icon: 'i-lucide-pencil',
tooltip: 'studio.actions.tooltips.rename-item',
tooltip: 'studio.actions.tooltips.renameItem',
},
{
id: StudioItemActionId.DuplicateItem,
label: 'studio.actions.labels.duplicate-item',
label: 'studio.actions.labels.duplicateItem',
icon: 'i-lucide-copy',
tooltip: 'studio.actions.tooltips.duplicate-item',
tooltip: 'studio.actions.tooltips.duplicateItem',
},
{
id: StudioItemActionId.DeleteItem,
label: 'studio.actions.labels.delete-item',
label: 'studio.actions.labels.deleteItem',
icon: 'i-lucide-trash',
tooltip: 'studio.actions.tooltips.delete-item',
tooltip: 'studio.actions.tooltips.deleteItem',
},
] as const

export const STUDIO_BRANCH_ACTION_DEFINITIONS: StudioAction<StudioBranchActionId>[] = [{
id: StudioBranchActionId.PublishBranch,
label: 'studio.actions.labels.publish-branch',
label: 'studio.actions.labels.publishBranch',
icon: 'i-lucide-rocket',
tooltip: 'studio.actions.tooltips.publish-branch',
tooltip: 'studio.actions.tooltips.publishBranch',
}] as const

export function computeItemActions(itemActions: StudioAction<StudioItemActionId>[], item: TreeItem | null, feature: StudioFeature | null): StudioAction<StudioItemActionId>[] {
Expand Down
Loading