From 2d4ec221457072fe2d44a330a830a72e904cc5db Mon Sep 17 00:00:00 2001 From: horacioskrp Date: Thu, 12 Nov 2026 04:12:08 +0000 Subject: [PATCH 01/12] =?UTF-8?q?feat(i18n):=20param=C3=A8tres=20=E2=80=94?= =?UTF-8?q?=20mati=C3=A8res=20(liste,=20cr=C3=A9ation,=20=C3=A9dition,=20d?= =?UTF-8?q?=C3=A9tail)=20(FR/EN)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/en/parametres.php | 62 +++++++++++++++++++ lang/fr/parametres.php | 62 +++++++++++++++++++ .../js/components/Subjects/subject-form.tsx | 42 +++++++------ .../js/pages/Parametres/Subjects/Create.tsx | 8 ++- .../js/pages/Parametres/Subjects/Edit.tsx | 8 ++- .../js/pages/Parametres/Subjects/Index.tsx | 58 ++++++++--------- .../js/pages/Parametres/Subjects/Show.tsx | 33 +++++----- 7 files changed, 204 insertions(+), 69 deletions(-) diff --git a/lang/en/parametres.php b/lang/en/parametres.php index c79e6570..61c76954 100644 --- a/lang/en/parametres.php +++ b/lang/en/parametres.php @@ -248,4 +248,66 @@ 'mention_label_ph' => 'Label (e.g. Congratulations)', 'mentions_hint' => 'The honor applied is the one with the highest threshold less than or equal to the average.', ], + + 'subjects' => [ + 'head' => 'Subjects', + 'title' => 'Subjects', + 'subtitle' => 'Manage the subjects taught', + 'new' => 'New subject', + 'stat_total' => 'Total subjects', + 'stat_shown' => 'Results shown', + 'stat_page' => 'Page', + 'search_ph' => 'Search a subject by name or code...', + 'search_results' => 'Results for:', + 'th_code' => 'Code', + 'th_name' => 'Name', + 'th_description' => 'Description', + 'no_description' => 'No description', + 'empty' => 'No subject found', + 'page_showing' => 'Showing', + 'page_to' => 'to', + 'page_of' => 'of', + 'page_unit' => 'subjects', + 'page_label' => 'Page', + 'delete_title' => 'Delete subject', + 'delete_desc' => 'Are you sure you want to delete this subject? This action is irreversible.', + 'deleting' => 'Deleting...', + + 'create_head' => 'Create a subject', + 'create_title' => 'Create a subject', + 'create_subtitle' => 'Enter the subject information.', + 'edit_head' => 'Edit :name', + 'edit_title' => 'Edit a subject', + 'edit_subtitle' => 'Update the information for :name.', + + 'show_subtitle' => 'Subject detail and tracking.', + 'info_section' => 'Subject information', + 'description' => 'Description', + 'show_no_description' => 'No description provided for this subject.', + 'history' => 'History', + 'created_on' => 'Created on', + 'updated_on' => 'Last updated', + 'summary' => 'Summary', + 'summary_before' => 'The subject', + 'summary_middle' => 'is identified by the code', + 'summary_stats' => 'Usage statistics will be shown here as soon as they are available.', + 'edit_this' => 'Edit this subject', + + 'form_section' => 'Subject information', + 'code_label' => 'Code *', + 'code_ph' => 'e.g. MATH101', + 'code_hint' => 'Unique code used to identify the subject.', + 'name_label' => 'Name *', + 'name_ph' => 'e.g. Mathematics', + 'parent_label' => 'Parent subject (sub-subject)', + 'no_parent' => 'None (main subject)', + 'parent_hint' => 'Attach this subject to a main subject to make it a sub-subject (e.g. "Dictation" under "French").', + 'description_label' => 'Description', + 'description_ph' => 'Briefly describe the content and objectives of the subject...', + 'description_hint' => 'Optional, maximum 1000 characters.', + 'preview' => 'Preview', + 'preview_code' => 'CODE', + 'preview_name' => 'Subject name', + 'submit_create' => 'Create subject', + ], ]; diff --git a/lang/fr/parametres.php b/lang/fr/parametres.php index 521ca92e..c4cf5bc3 100644 --- a/lang/fr/parametres.php +++ b/lang/fr/parametres.php @@ -248,4 +248,66 @@ 'mention_label_ph' => 'Libellé (ex : Félicitations)', 'mentions_hint' => 'La mention retenue est celle dont le seuil est le plus élevé et inférieur ou égal à la moyenne.', ], + + 'subjects' => [ + 'head' => 'Matières', + 'title' => 'Matières', + 'subtitle' => 'Gérez les matières enseignées', + 'new' => 'Nouvelle matière', + 'stat_total' => 'Matières totales', + 'stat_shown' => 'Résultats affichés', + 'stat_page' => 'Page', + 'search_ph' => 'Rechercher une matière par nom ou code...', + 'search_results' => 'Résultats pour :', + 'th_code' => 'Code', + 'th_name' => 'Nom', + 'th_description' => 'Description', + 'no_description' => 'Aucune description', + 'empty' => 'Aucune matière trouvée', + 'page_showing' => 'Affichage', + 'page_to' => 'à', + 'page_of' => 'sur', + 'page_unit' => 'matières', + 'page_label' => 'Page', + 'delete_title' => 'Supprimer la matière', + 'delete_desc' => 'Êtes-vous sûr de vouloir supprimer cette matière ? Cette action est irréversible.', + 'deleting' => 'Suppression...', + + 'create_head' => 'Créer une matière', + 'create_title' => 'Créer une matière', + 'create_subtitle' => 'Renseignez les informations de la matière.', + 'edit_head' => 'Éditer :name', + 'edit_title' => 'Éditer une matière', + 'edit_subtitle' => 'Mettez à jour les informations de :name.', + + 'show_subtitle' => 'Détail et suivi de la matière.', + 'info_section' => 'Informations de la matière', + 'description' => 'Description', + 'show_no_description' => 'Aucune description renseignée pour cette matière.', + 'history' => 'Historique', + 'created_on' => 'Créée le', + 'updated_on' => 'Dernière modification', + 'summary' => 'Résumé', + 'summary_before' => 'La matière', + 'summary_middle' => 'est identifiée par le code', + 'summary_stats' => 'Les statistiques d\'utilisation seront affichées ici dès qu\'elles seront disponibles.', + 'edit_this' => 'Modifier cette matière', + + 'form_section' => 'Informations de la matière', + 'code_label' => 'Code *', + 'code_ph' => 'Ex: MATH101', + 'code_hint' => 'Code unique utilisé pour identifier la matière.', + 'name_label' => 'Nom *', + 'name_ph' => 'Ex: Mathématiques', + 'parent_label' => 'Matière parente (sous-matière)', + 'no_parent' => 'Aucune (matière principale)', + 'parent_hint' => 'Rattachez cette matière à une matière principale pour en faire une sous-matière (ex. « Dictée » sous « Français »).', + 'description_label' => 'Description', + 'description_ph' => 'Décrivez brièvement le contenu et les objectifs de la matière...', + 'description_hint' => 'Optionnel, maximum 1000 caractères.', + 'preview' => 'Aperçu', + 'preview_code' => 'CODE', + 'preview_name' => 'Nom de la matière', + 'submit_create' => 'Créer la matière', + ], ]; diff --git a/resources/js/components/Subjects/subject-form.tsx b/resources/js/components/Subjects/subject-form.tsx index 13d9279e..868a69e6 100644 --- a/resources/js/components/Subjects/subject-form.tsx +++ b/resources/js/components/Subjects/subject-form.tsx @@ -3,6 +3,7 @@ import { Button } from '@/components/ui/button'; import { Input } from '@/components/ui/input'; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select'; import { Textarea } from '@/components/ui/textarea'; +import { useTranslation } from '@/helpers/i18n'; export interface SubjectFormData { name: string; @@ -36,14 +37,15 @@ export function SubjectForm({ onSubmit, setData, }: Readonly) { - let submitLabel = 'Mettre à jour'; + const { t } = useTranslation(); + let submitLabel = t('parametres.common.update'); if (processing && mode === 'create') { - submitLabel = 'Création...'; + submitLabel = t('parametres.common.creating'); } else if (processing) { - submitLabel = 'Mise à jour...'; + submitLabel = t('parametres.common.updating'); } else if (mode === 'create') { - submitLabel = 'Créer la matière'; + submitLabel = t('parametres.subjects.submit_create'); } return ( @@ -53,39 +55,39 @@ export function SubjectForm({
-

Informations de la matière

+

{t('parametres.subjects.form_section')}

- + setData('code', event.target.value.toUpperCase())} disabled={processing} - placeholder="Ex: MATH101" + placeholder={t('parametres.subjects.code_ph')} className={errors.code ? 'border-red-500 bg-red-50/40' : 'border-gray-200 bg-white focus-visible:ring-blue-500'} /> -

Code unique utilise pour identifier la matière.

+

{t('parametres.subjects.code_hint')}

{errors.code &&

{errors.code}

}
- + setData('name', event.target.value)} disabled={processing} - placeholder="Ex: Mathématiques" + placeholder={t('parametres.subjects.name_ph')} className={errors.name ? 'border-red-500 bg-red-50/40' : 'border-gray-200 bg-white focus-visible:ring-blue-500'} /> {errors.name &&

{errors.name}

}
- + -

Rattachez cette matière à une matière principale pour en faire une sous-matière (ex. « Dictée » sous « Français »).

+

{t('parametres.subjects.parent_hint')}

- +