From dafd84fd66a6868314000502a55afa7474625f94 Mon Sep 17 00:00:00 2001 From: Okke Harsta Date: Wed, 11 Dec 2024 09:45:36 +0100 Subject: [PATCH] Format number of entities with locale --- client/src/components/Entities.jsx | 2 +- client/src/tabs/Users.js | 10 ---------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/client/src/components/Entities.jsx b/client/src/components/Entities.jsx index 1c40994..1858c2b 100644 --- a/client/src/components/Entities.jsx +++ b/client/src/components/Entities.jsx @@ -81,7 +81,7 @@ export const Entities = ({ return (
{(!hideTitle) && -

{title || `${I18n.t(`${modelName}.title`)} (${totalElements || entities.length})`}

} +

{title || `${I18n.t(`${modelName}.title`)} (${(totalElements || entities.length).toLocaleString()})`}

} {(loading || hideTitle) && } {!isEmpty(filters) &&
{filters}
}
diff --git a/client/src/tabs/Users.js b/client/src/tabs/Users.js index 1634e55..2748f45 100644 --- a/client/src/tabs/Users.js +++ b/client/src/tabs/Users.js @@ -142,22 +142,12 @@ export const Users = () => { : }) } - const hasEntities = totalElements > 0; - let title = ""; - - if (hasEntities) { - title = I18n.t(`users.found`, { - count: totalElements.toLocaleString(), - plural: I18n.t(`users.${totalElements === 1 ? "singleUser" : "multipleUsers"}`) - }) - } return (
navigate(`/invitation/new?maintainer=true`)}