Skip to content

Commit

Permalink
style: adjust t
Browse files Browse the repository at this point in the history
  • Loading branch information
nkgentile committed Nov 13, 2024
1 parent 6a7ae3a commit 2ee472b
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/actions/DuplicateWithTranslationsAction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ export const DuplicateWithTranslationsAction: DocumentActionComponent = ({
const metadataDocument = Array.isArray(data) && data.length ? data[0] : null
const client = useClient(DEFAULT_STUDIO_CLIENT_OPTIONS)
const toast = useToast()
const {t: structureT} = useTranslation(structureLocaleNamespace)
const {t: documenti18nT} = useTranslation(documenti18nLocaleNamespace)
const {t: tStructure} = useTranslation(structureLocaleNamespace)
const {t: tPlugin} = useTranslation(documenti18nLocaleNamespace)
const currentUser = useCurrentUser()

const handle = useCallback(async () => {
Expand Down Expand Up @@ -184,7 +184,7 @@ export const DuplicateWithTranslationsAction: DocumentActionComponent = ({
return {
icon: CopyIcon,
disabled: true,
label: documenti18nT('action.duplicate.label'),
label: tPlugin('action.duplicate.label'),
title: (
<InsufficientPermissionsMessage
context="duplicate-document"
Expand All @@ -198,17 +198,17 @@ export const DuplicateWithTranslationsAction: DocumentActionComponent = ({
return {
icon: CopyIcon,
disabled: true,
label: documenti18nT('action.duplicate.label'),
title: documenti18nT(DISABLED_REASON_KEY.METADATA_NOT_FOUND),
label: tPlugin('action.duplicate.label'),
title: tPlugin(DISABLED_REASON_KEY.METADATA_NOT_FOUND),
}
}

if (!hasOneMetadataDocument) {
return {
icon: CopyIcon,
disabled: true,
label: documenti18nT('action.duplicate.label'),
title: documenti18nT(DISABLED_REASON_KEY.MULTIPLE_METADATA),
label: tPlugin('action.duplicate.label'),
title: tPlugin(DISABLED_REASON_KEY.MULTIPLE_METADATA),
}
}

Expand All @@ -220,16 +220,16 @@ export const DuplicateWithTranslationsAction: DocumentActionComponent = ({
isPermissionsLoading ||
isMetadataDocumentLoading,
label: isDuplicating
? structureT('action.duplicate.running.label')
: documenti18nT('action.duplicate.label'),
? tStructure('action.duplicate.running.label')
: tPlugin('action.duplicate.label'),
title: duplicate.disabled
? structureT(DISABLED_REASON_KEY[duplicate.disabled])
? tStructure(DISABLED_REASON_KEY[duplicate.disabled])
: '',
onHandle: handle,
}
}, [
currentUser,
documenti18nT,
tPlugin,
duplicate.disabled,
handle,
hasOneMetadataDocument,
Expand All @@ -238,7 +238,7 @@ export const DuplicateWithTranslationsAction: DocumentActionComponent = ({
isPermissionsLoading,
metadataDocument,
permissions?.granted,
structureT,
tStructure,
])
}

Expand Down

0 comments on commit 2ee472b

Please sign in to comment.