diff --git a/lang/en/back.php b/lang/en/back.php index f08502d5..13215f50 100644 --- a/lang/en/back.php +++ b/lang/en/back.php @@ -14,6 +14,7 @@ return [ "yes_delete" => "Yes, delete", "yes_update" => "Yes, update", "yes_restore" => "Yes, restore", + "yes_archive" => "Yes, archive", "no_cancel" => "No, cancel", "yes" => "Yes", "no" => "No", @@ -90,4 +91,5 @@ return [ "unsupported_type" => "Unsupported type:", "missing_translations" => "The translation of the :field for the language :locales is missing.|The translation of the :field for :locales languages are missing.", + "archives" => "archives", ]; diff --git a/lang/en/crud.php b/lang/en/crud.php index 385966d6..a9645828 100644 --- a/lang/en/crud.php +++ b/lang/en/crud.php @@ -2,15 +2,15 @@ return [ "actions" => [ - "list" => "list", - "creation" => "creation", - "visualization" => "visualization", - "duplication" => "duplication", - "edition" => "edition", - "suppression" => "suppression", - "archivation" => "archivation", - "restoration" => "restoration", - "save" => "save", + "list" => "list", + "create" => "create", + "visualize" => "visualize", + "duplicate" => "duplicate", + "edit" => "edit", + "delete" => "delete", + "archive" => "archive", + "restore" => "restore", + "save" => "save", ], "helpers" => [ @@ -19,9 +19,7 @@ return [ "visualization_model" => "Visualization :model", "duplication_model" => "Duplication :model", "edition_model" => "Edition :model", - "suppression_model" => "Suppression :model", - "archivation_model" => "Archivation :model", - "restoration_model" => "Restoration :model", + "archives_model" => "Archives :model", "save_model" => "Save :model", "no_results" => "No results for :model", "publish" => "Published", diff --git a/lang/fr/back.php b/lang/fr/back.php index 9e599890..ef5be9fb 100644 --- a/lang/fr/back.php +++ b/lang/fr/back.php @@ -14,6 +14,7 @@ return [ "yes_delete" => "Oui, supprimer", "yes_update" => "Oui, mettre à jour", "yes_restore" => "Oui, restorer", + "yes_archive" => "Oui, archiver", "no_cancel" => "Non, annuler", "yes" => "Oui", "no" => "Non", @@ -90,4 +91,5 @@ return [ "unsupported_type" => "Type non supporté:", "missing_translations" => "La traduction du champs :field pour la langue :locales est manquante.|La traduction du champs :field pour les langues :locales sont manquantes.", + "archives" => "archives", ]; diff --git a/lang/fr/crud.php b/lang/fr/crud.php index b107d656..d9f88bb0 100644 --- a/lang/fr/crud.php +++ b/lang/fr/crud.php @@ -2,15 +2,15 @@ return [ "actions" => [ - "list" => "liste", - "creation" => "création", - "visualization" => "visualisation", - "duplication" => "duplication", - "edition" => "édition", - "suppression" => "suppression", - "archivation" => "archivation", - "restoration" => "restoration", - "save" => "sauvegarder", + "list" => "lister", + "create" => "créer", + "visualize" => "visualiser", + "duplicate" => "dupliquer", + "edit" => "éditer", + "delete" => "supprimer", + "archive" => "archiver", + "restore" => "restorer", + "save" => "sauvegarder", ], "helpers" => [ @@ -19,9 +19,7 @@ return [ "visualization_model" => "Visualisation :model", "duplication_model" => "Duplication :model", "edition_model" => "Édition :model", - "suppression_model" => "Suppression :model", - "archivation_model" => "Archivation :model", - "restoration_model" => "Restoration :model", + "archives_model" => "Archives :model", "save_model" => "Sauvegarder :model", "no_results" => "Aucun résultat pour :model", "publish" => "Publié", diff --git a/resources/ts/back/Components/Layout/AppSidebar.tsx b/resources/ts/back/Components/Layout/AppSidebar.tsx index 6007c490..959087b5 100644 --- a/resources/ts/back/Components/Layout/AppSidebar.tsx +++ b/resources/ts/back/Components/Layout/AppSidebar.tsx @@ -120,7 +120,7 @@ export default function AppSidebar() { key="trash" route={route(`back.${model}.trash`)} icon={Views.ARCHIVATION.icon} - trans={str(useTrans(`crud.actions.${Views.ARCHIVATION.label}`)).ucFirst().value()} + trans={str(useTrans("back.archives")).ucFirst().value()} /> ), ]}) @@ -142,7 +142,7 @@ export default function AppSidebar() { key="trash" route={route(`back.${model}.trash`)} icon={Views.ARCHIVATION.icon} - trans={str(useTrans(`crud.actions.${Views.ARCHIVATION.label}`)).ucFirst().value()} + trans={str(useTrans("back.archives")).ucFirst().value()} /> ), ]}) diff --git a/resources/ts/back/Components/ModelActions.tsx b/resources/ts/back/Components/ModelActions.tsx index 96b53273..3640dab0 100644 --- a/resources/ts/back/Components/ModelActions.tsx +++ b/resources/ts/back/Components/ModelActions.tsx @@ -155,7 +155,7 @@ export default function ModelActions({ const isRestoreAction = action.label === Views.RESTORATION.label; const isArchiveAction = action.label === Views.ARCHIVATION.label; const btnVariantType = isRestoreAction ? "ghost" : "destructive"; - const btnConfirm = useTrans(isRestoreAction ? "back.yes_restore" : "back.yes_delete"); + const btnConfirm = useTrans(isRestoreAction ? "back.yes_restore" : isArchiveAction ? "back.yes_archive" : "back.yes_delete"); const btnDesc = useTrans(isRestoreAction ? "back.restore_data" : isArchiveAction ? "back.trash_data" : "back.lost_data"); return ( diff --git a/resources/ts/back/Pages/DynamicPages/Index.tsx b/resources/ts/back/Pages/DynamicPages/Index.tsx index 170a3160..df16f662 100644 --- a/resources/ts/back/Pages/DynamicPages/Index.tsx +++ b/resources/ts/back/Pages/DynamicPages/Index.tsx @@ -130,7 +130,7 @@ export default function Dashboard({ ]; const transModel = useTrans("models.classes.dynamic-page", { choice: 2 }); - const transArchiveTitle = useTrans("crud.helpers.archivation_model", { params: { model: transModel }}) + const transArchiveTitle = useTrans("crud.helpers.archives_model", { params: { model: transModel }}) const transTitle = str(isArchiveRoute ? transArchiveTitle : transModel).ucFirst().value(); const beforeNode = () => { diff --git a/resources/ts/lib/utils.ts b/resources/ts/lib/utils.ts index 2c2380d6..28f6d0d7 100644 --- a/resources/ts/lib/utils.ts +++ b/resources/ts/lib/utils.ts @@ -26,49 +26,49 @@ export function cn(...inputs: ClassValue[]): string { */ export const Views = { CREATION: { - label: "creation", + label: "create", value: "create", policy: "create", icon: Plus, }, VISUALIZATION: { - label: "visualization", + label: "visualize", value: "show", policy: "view", icon: Eye, }, EDITION: { - label: "edition", + label: "edit", value: "edit", policy: "update", icon: Pencil, }, DUPLICATION: { - label: "duplication", + label: "duplicate", value: "duplicate", policy: "duplicate", icon: Copy, }, ARCHIVATION: { - label: "archivation", + label: "archive", value: "destroy", policy: "delete", icon: Archive, }, RESTORATION: { - label: "restoration", + label: "restore", value: "restore", policy: "restore", icon: ArchiveRestore, }, DELETION: { - label: "suppression", + label: "delete", value: "destroy", policy: "delete", icon: Trash2, }, FORCEDELETION: { - label: "suppression", + label: "delete", value: "forceDestroy", policy: "forceDelete", icon: Trash2,