From 084ab916f3e6f009b6fd6266440342e2e0fd760d Mon Sep 17 00:00:00 2001 From: MiraGeowerkstatt Date: Thu, 15 Aug 2024 10:28:46 +0200 Subject: [PATCH] User i18n plurals --- src/client/public/locale/de/common.json | 4 +-- src/client/public/locale/en/common.json | 4 +-- src/client/public/locale/fr/common.json | 4 +-- src/client/public/locale/it/common.json | 4 +-- src/client/src/pages/detail/detailHeader.tsx | 2 +- .../overview/boreholeTable/bottomBar.tsx | 27 ++++++++----------- 6 files changed, 20 insertions(+), 25 deletions(-) diff --git a/src/client/public/locale/de/common.json b/src/client/public/locale/de/common.json index 0e8f2e15a..b4c2d5d4c 100644 --- a/src/client/public/locale/de/common.json +++ b/src/client/public/locale/de/common.json @@ -90,8 +90,8 @@ "degree": "Grad", "delete": "Löschen", "deleteBorehole": "Bohrloch löschen", - "deleteBoreholeMessage": "Wollen Sie dieses Bohrloch wirklich löschen? Dies kann nicht rückgängig gemacht werden.", - "deleteBoreholesMessage": "Wollen Sie diese {{count}} Bohrungen wirklich löschen? Diese Aktion kann nicht rückgängig gemacht werden.", + "deleteBoreholesMessage_one": "Wollen Sie diese Bohrung wirklich löschen? Diese Aktion kann nicht rückgängig gemacht werden.", + "deleteBoreholesMessage_other": "Wollen Sie diese {{count}} Bohrungen wirklich löschen? Diese Aktion kann nicht rückgängig gemacht werden.", "deleteCompletionMessage": "Wollen Sie diesen Ausbau wirklich löschen? Der Ausbau wird zusammen mit seinen Verrohrungen, Instrumentierungen und Verfüllung/Hinterfüllungen dauerhaft gelöscht.", "deleteForever": "Dauerhaft löschen", "deleteMessage": "Wollen Sie diesen Eintrag wirklich löschen? Der Eintrag wird dauerhaft aus der Datenbank gelöscht.", diff --git a/src/client/public/locale/en/common.json b/src/client/public/locale/en/common.json index 9d381e77e..e95b02477 100644 --- a/src/client/public/locale/en/common.json +++ b/src/client/public/locale/en/common.json @@ -90,8 +90,8 @@ "degree": "Degrees", "delete": "Delete", "deleteBorehole": "Delete borehole", - "deleteBoreholeMessage": "Do you really want to delete this borehole? This cannot be undone.", - "deleteBoreholesMessage": "Do you really want to delete these {{count}} boreholes? This cannot be undone.", + "deleteBoreholesMessage_one": "Do you really want to delete this borehole? This cannot be undone.", + "deleteBoreholesMessage_other": "Do you really want to delete these {{count}} boreholes? This cannot be undone.", "deleteCompletionMessage": "Do you really want to delete this completion? This completion including its casings, instruments and sealing/backfilling will be permanently deleted from the database.", "deleteForever": "Delete permanently", "deleteMessage": "Do you really want to delete this entry? The entry will be permanently deleted from the database.", diff --git a/src/client/public/locale/fr/common.json b/src/client/public/locale/fr/common.json index 2a273fa3a..a37640466 100644 --- a/src/client/public/locale/fr/common.json +++ b/src/client/public/locale/fr/common.json @@ -90,8 +90,8 @@ "degree": "Degrés", "delete": "Supprimer", "deleteBorehole": "Supprimer forage", - "deleteBoreholeMessage": "Voulez-vous vraiment effacer ce trou de forage? Cela ne peut pas être annulé.", - "deleteBoreholesMessage": "Voulez-vous vraiment supprimer ces {{count}} forages? Cela ne peut pas être annulé.", + "deleteBoreholesMessage_one": "Voulez-vous vraiment effacer ce trou de forage? Cela ne peut pas être annulé.", + "deleteBoreholesMessage_other": "Voulez-vous vraiment supprimer ces {{count}} forages? Cela ne peut pas être annulé.", "deleteCompletionMessage": "Voulez-vous vraiment supprimer cet aménagement? Cet aménagement, y compris les tubage, les instruments et les remplissages/remblayages, sera définitivement supprimé de la base de données.", "deleteForever": "Supprimer définitivement", "deleteMessage": "Voulez-vous vraiment supprimer cette entrée? L'entrée sera définitivement supprimée de la base de données.", diff --git a/src/client/public/locale/it/common.json b/src/client/public/locale/it/common.json index 9ea47368f..42bb33f51 100644 --- a/src/client/public/locale/it/common.json +++ b/src/client/public/locale/it/common.json @@ -90,8 +90,8 @@ "degree": "Gradi", "delete": "Elimina", "deleteBorehole": "Elimina perforazione", - "deleteBoreholeMessage": "Volete davvero cancellare questo foro? Non è possibile annullare questa operazione.", - "deleteBoreholesMessage": "Volete davvero cancellare questi {{count}} fori? Non è possibile annullare questa operazione.", + "deleteBoreholesMessage_one": "Volete davvero cancellare questo foro? Non è possibile annullare questa operazione.", + "deleteBoreholesMessage_other": "Volete davvero cancellare questi {{count}} fori? Non è possibile annullare questa operazione.", "deleteCompletionMessage": "Volete davvero cancellare questo installazione? Questo installazione, compresi gli tubazione, gli strumenti e i riempimenti/rinterri, sarà cancellato definitivamente dal database.", "deleteForever": "Elimina definitivamente", "deleteMessage": "Volete davvero eliminare questa voce? La voce verrà eliminata definitivamente dal database.", diff --git a/src/client/src/pages/detail/detailHeader.tsx b/src/client/src/pages/detail/detailHeader.tsx index d9964754f..7cfad8115 100644 --- a/src/client/src/pages/detail/detailHeader.tsx +++ b/src/client/src/pages/detail/detailHeader.tsx @@ -114,7 +114,7 @@ const DetailHeader = () => { - showPrompt(t("deleteBoreholeMessage"), [ + showPrompt(t("deleteBoreholesMessage", { count: 1 }), [ { label: t("cancel"), }, diff --git a/src/client/src/pages/overview/boreholeTable/bottomBar.tsx b/src/client/src/pages/overview/boreholeTable/bottomBar.tsx index 85ea79aed..d5e553ccd 100644 --- a/src/client/src/pages/overview/boreholeTable/bottomBar.tsx +++ b/src/client/src/pages/overview/boreholeTable/bottomBar.tsx @@ -95,22 +95,17 @@ const BottomBar = ({ - showPrompt( - selectionModel.length > 1 - ? t("deleteBoreholesMessage", { count: selectionModel.length }) - : t("deleteBoreholeMessage"), - [ - { - label: t("cancel"), - }, - { - label: t("delete"), - icon: , - variant: "contained", - action: onDeleteMultiple, - }, - ], - ) + showPrompt(t("deleteBoreholesMessage", { count: selectionModel.length }), [ + { + label: t("cancel"), + }, + { + label: t("delete"), + icon: , + variant: "contained", + action: onDeleteMultiple, + }, + ]) } /> {selectionModel.length === 1 && showCopyPromptForSelectedWorkgroup()} />}