From 8d10d682b77b156f7a5533969c1af46eec26dd47 Mon Sep 17 00:00:00 2001 From: Hameur Date: Mon, 9 Dec 2024 22:59:43 +0100 Subject: [PATCH] fix unsaved-change and some rtl --- apps/desk/src/renderer/public/locales/ar.json | 11 ++++++++-- apps/desk/src/renderer/public/locales/en.json | 9 +++++++- apps/desk/src/renderer/public/locales/fr.json | 9 +++++++- apps/desk/src/renderer/src/assets/globals.css | 5 +++++ .../renderer/src/components/DeleteModal.tsx | 10 +++++---- .../renderer/src/components/ExportModal.tsx | 21 +++++++++++-------- .../renderer/src/components/ImportModal.tsx | 14 +++++++------ .../renderer/src/components/ListingHeader.tsx | 4 ++-- .../src/components/unsaved-change-edit.tsx | 15 ++++++++----- 9 files changed, 68 insertions(+), 30 deletions(-) diff --git a/apps/desk/src/renderer/public/locales/ar.json b/apps/desk/src/renderer/public/locales/ar.json index c416d02d..64b27105 100644 --- a/apps/desk/src/renderer/public/locales/ar.json +++ b/apps/desk/src/renderer/public/locales/ar.json @@ -130,10 +130,13 @@ "import": "استيراد", "sortBy": "ترتيب حسب", "filter": "تصفية", + "next": "التالي", "drag": "اسحب ملفك (ملفاتك) لبدء التحميل", "browseFiles": "تصفح الملفات", - "or" : "أو", - "onlyXls" : "يسمح فقط بملفات .xls" + "or": "أو", + "onlyXls": "يسمح فقط بملفات .xls", + "discard": "تجاهل", + "keepEditing": "استمر في التحرير" }, "participantsTable": { "id": "المعرف", @@ -327,6 +330,10 @@ "messageLogo": "هل تريد استيراد الشعار؟", "titleDocument": "استيراد المستند", "messageDocument": "هل تريد استيراد المستند؟" + }, + "unsavedChanges": { + "title" : "تجاهل التغييرات غير المحفوظة؟", + "message": "سيتم فقدان أي تغييرات غير محفوظة. هل أنت متأكد أنك تريد الإلغاء وتجاهل التعديلات الخاصة بك؟" } } } \ No newline at end of file diff --git a/apps/desk/src/renderer/public/locales/en.json b/apps/desk/src/renderer/public/locales/en.json index 5c7a4636..7f5979e9 100644 --- a/apps/desk/src/renderer/public/locales/en.json +++ b/apps/desk/src/renderer/public/locales/en.json @@ -130,10 +130,13 @@ "import": "Import", "sortBy": "Sort By", "filter": "Filter", + "next": "Next", "drag": "Drag your file(s) to start uploading", "browseFiles": "Browse Files", "or": "Or", - "onlyXls" : "Only .xls files are allowed" + "onlyXls": "Only .xls files are allowed", + "discard": "Discard", + "keepEditing": "Keep Editing" }, "participantsTable": { "id": "ID", @@ -327,6 +330,10 @@ "messageLogo": "Are you sure you want to import this data?", "titleDocument": "Import Document", "messageDocument": "Are you sure you want to import this document?" + }, + "unsavedChanges": { + "title": "Discard Unsaved Changes?", + "message": "Any unsaved changes will be lost. Are you sure you want to cancel and discard your edits?" } } } \ No newline at end of file diff --git a/apps/desk/src/renderer/public/locales/fr.json b/apps/desk/src/renderer/public/locales/fr.json index f422ee69..f56ded22 100644 --- a/apps/desk/src/renderer/public/locales/fr.json +++ b/apps/desk/src/renderer/public/locales/fr.json @@ -130,10 +130,13 @@ "import": "Importer", "sortBy": "Trier par", "filter": "Filtrer", + "next": "Suivant", "drag": "Faites glisser votre (vos) fichier(s) pour commencer le téléchargement", "browseFiles": "Parcourir les fichiers", "or": "Ou", - "onlyXls": "Seuls les fichiers .xls sont autorisés" + "onlyXls": "Seuls les fichiers .xls sont autorisés", + "discard": "Annuler", + "keepEditing": "Continuer l'édition" }, "participantsTable": { "id": "ID", @@ -327,6 +330,10 @@ "messageLogo": "Voulez-vous importer le Logo ?", "titleDocument": "Importer le document", "messageDocument": "Voulez-vous importer le document ?" + }, + "unsavedChanges": { + "title": "Annuler les modifications non enregistrées ?", + "message": "Toutes les modifications non enregistrées seront perdues. Êtes-vous sûr de vouloir annuler et supprimer vos modifications ?" } } } \ No newline at end of file diff --git a/apps/desk/src/renderer/src/assets/globals.css b/apps/desk/src/renderer/src/assets/globals.css index 7d9f89c7..20444f78 100644 --- a/apps/desk/src/renderer/src/assets/globals.css +++ b/apps/desk/src/renderer/src/assets/globals.css @@ -4,6 +4,7 @@ @import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap'); /* @import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap'); */ +@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap'); body { font-family: 'Poppins', sans-serif; @@ -90,4 +91,8 @@ body { .font-poppins { font-family: "Poppins", sans-serif; +} + +.font-roboto { + font-family: "Roboto", sans-serif; } \ No newline at end of file diff --git a/apps/desk/src/renderer/src/components/DeleteModal.tsx b/apps/desk/src/renderer/src/components/DeleteModal.tsx index 06849009..634ef7ab 100644 --- a/apps/desk/src/renderer/src/components/DeleteModal.tsx +++ b/apps/desk/src/renderer/src/components/DeleteModal.tsx @@ -19,7 +19,7 @@ interface DeleteModalProps { } const DeleteModal: FC = ({ onDelete, DeleteNumber }: DeleteModalProps) => { - const { t } = useTranslate(); + const { t , isRtl } = useTranslate(); return ( @@ -43,15 +43,17 @@ const DeleteModal: FC = ({ onDelete, DeleteNumber }: DeleteMod {t('modals.delete.message')} -
+
- Cancel + {t('buttons.cancel')} - {'Delete'} + {t('buttons.delete')}
diff --git a/apps/desk/src/renderer/src/components/ExportModal.tsx b/apps/desk/src/renderer/src/components/ExportModal.tsx index 7078391a..3a9cef2c 100644 --- a/apps/desk/src/renderer/src/components/ExportModal.tsx +++ b/apps/desk/src/renderer/src/components/ExportModal.tsx @@ -6,40 +6,43 @@ import { useTranslate } from '@renderer/hooks/useTranslate'; import Upload from '@renderer/assets/images/Export.png'; const ExportModal = (): JSX.Element => { - const { t } = useTranslate(); + const { t ,isRtl } = useTranslate(); const handleExport = () => { console.log('Export'); }; - + return ( {/* */} - Upload + Upload {t('buttons.export')} - - + + + {t('modals.export.title')} {t('modals.export.message')} -
+
- Cancel + {t('buttons.cancel')} - Export + {t('buttons.export')}
diff --git a/apps/desk/src/renderer/src/components/ImportModal.tsx b/apps/desk/src/renderer/src/components/ImportModal.tsx index 7f830c7e..cbda273f 100644 --- a/apps/desk/src/renderer/src/components/ImportModal.tsx +++ b/apps/desk/src/renderer/src/components/ImportModal.tsx @@ -9,7 +9,7 @@ import Download from '@renderer/assets/images/Import.png' import FileUploader from './ui/fileUploader'; const ImportModal = (): JSX.Element => { - const { t } = useTranslate(); + const { t , isRtl } = useTranslate(); const handleEImport = (): void => { console.log('Import'); @@ -20,11 +20,11 @@ const ImportModal = (): JSX.Element => { {/* */} - Upload + Upload {t('buttons.import')} @@ -41,15 +41,17 @@ const ImportModal = (): JSX.Element => {

{t('buttons.onlyXls')}

-
+
- Cancel + {t('buttons.cancel')} - Next + {t('buttons.next')}
diff --git a/apps/desk/src/renderer/src/components/ListingHeader.tsx b/apps/desk/src/renderer/src/components/ListingHeader.tsx index 3e572733..9cdce257 100644 --- a/apps/desk/src/renderer/src/components/ListingHeader.tsx +++ b/apps/desk/src/renderer/src/components/ListingHeader.tsx @@ -43,9 +43,9 @@ const ListingHeader = ({ {!(headTitle === 'organization.organizations') && ( )} diff --git a/apps/desk/src/renderer/src/components/unsaved-change-edit.tsx b/apps/desk/src/renderer/src/components/unsaved-change-edit.tsx index 752af4a1..141dbaea 100644 --- a/apps/desk/src/renderer/src/components/unsaved-change-edit.tsx +++ b/apps/desk/src/renderer/src/components/unsaved-change-edit.tsx @@ -1,3 +1,4 @@ +import { useTranslate } from '@renderer/hooks/useTranslate'; import { Dialog, DialogClose, @@ -6,6 +7,7 @@ import { DialogTrigger, } from './ui/dialog'; import { DialogDescription } from '@radix-ui/react-dialog'; +import { cn } from './ui/lib/utils'; export default function UnsavedChangeEdit({ open, @@ -16,28 +18,31 @@ export default function UnsavedChangeEdit({ ConfermFn: () => void; KeepEditFn: () => void; }) { + const { t ,isRtl } = useTranslate(); return ( - Discard Unsaved Changes? + {t('modals.unsavedChanges.title')} - Lorem ipsum dolor sit amet consectetur adipisicing elit. Impedit natus + {t('modals.unsavedChanges.message')} -
+
- Keep Editing + {t('buttons.keepEditing')} - Discard + {t('buttons.discard')}