Skip to content

Commit 2d07b3d

Browse files
refactor(aurora-portal): use Lingui plural for bulk modal titles
1 parent c2a2419 commit 2d07b3d

6 files changed

Lines changed: 18 additions & 6 deletions

File tree

packages/aurora/src/client/routes/_auth/projects/$projectId/storage/-components/Swift/Containers/EmptyContainersModal.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useState } from "react"
2-
import { Trans, useLingui } from "@lingui/react/macro"
2+
import { Plural, Trans, useLingui } from "@lingui/react/macro"
33
import { trpcReact } from "@/client/trpcClient"
44
import { Modal, Spinner, Stack } from "@cloudoperators/juno-ui-components"
55
import { ContainerSummary } from "@/server/Storage/types/swift"
@@ -77,7 +77,7 @@ export const EmptyContainersModal = ({ isOpen, containers, onClose, onComplete }
7777

7878
return (
7979
<Modal
80-
title={totalCount === 1 ? t`Empty Container` : t`Empty Containers`}
80+
title={<Plural value={totalCount} one="Empty Container" other="Empty Containers" />}
8181
open={isOpen}
8282
onCancel={handleClose}
8383
confirmButtonLabel={isPending ? t`Emptying...` : t`Empty`}

packages/aurora/src/client/routes/_auth/projects/$projectId/storage/-components/Swift/Objects/DeleteObjectsModal.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Trans, useLingui } from "@lingui/react/macro"
1+
import { Plural, Trans, useLingui } from "@lingui/react/macro"
22
import { trpcReact } from "@/client/trpcClient"
33
import { Modal, Spinner, Stack } from "@cloudoperators/juno-ui-components"
44
import { useProjectId } from "@/client/hooks/useProjectId"
@@ -90,7 +90,7 @@ export const DeleteObjectsModal = ({
9090

9191
return (
9292
<Modal
93-
title={totalCount === 1 ? t`Delete Object` : t`Delete Objects`}
93+
title={<Plural value={totalCount} one="Delete Object" other="Delete Objects" />}
9494
open={isOpen}
9595
onCancel={handleClose}
9696
confirmButtonLabel={isPending ? t`Deleting...` : t`Delete`}

packages/aurora/src/locales/de/messages.po

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,12 @@ msgstr "{totalCount, plural, one {{totalCount} Bucket} other {{totalCount} Bucke
7676
msgid "{totalCount, plural, one {{totalCount} container} other {{totalCount} containers}}"
7777
msgstr "{totalCount, plural, one {{totalCount} Container} other {{totalCount} Container}}"
7878

79+
msgid "{totalCount, plural, one {Delete Object} other {Delete Objects}}"
80+
msgstr ""
81+
82+
msgid "{totalCount, plural, one {Empty Container} other {Empty Containers}}"
83+
msgstr ""
84+
7985
msgid "{totalItemCount, plural, one {{filteredItemCount} of {totalItemCount} item} other {{filteredItemCount} of {totalItemCount} items}}"
8086
msgstr "{totalItemCount, plural, one {{filteredItemCount} von {totalItemCount} Element} other {{filteredItemCount} von {totalItemCount} Elementen}}"
8187

packages/aurora/src/locales/de/messages.ts

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

packages/aurora/src/locales/en/messages.po

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,12 @@ msgstr "{totalCount, plural, one {{totalCount} bucket} other {{totalCount} bucke
7676
msgid "{totalCount, plural, one {{totalCount} container} other {{totalCount} containers}}"
7777
msgstr "{totalCount, plural, one {{totalCount} container} other {{totalCount} containers}}"
7878

79+
msgid "{totalCount, plural, one {Delete Object} other {Delete Objects}}"
80+
msgstr "{totalCount, plural, one {Delete Object} other {Delete Objects}}"
81+
82+
msgid "{totalCount, plural, one {Empty Container} other {Empty Containers}}"
83+
msgstr "{totalCount, plural, one {Empty Container} other {Empty Containers}}"
84+
7985
msgid "{totalItemCount, plural, one {{filteredItemCount} of {totalItemCount} item} other {{filteredItemCount} of {totalItemCount} items}}"
8086
msgstr "{totalItemCount, plural, one {{filteredItemCount} of {totalItemCount} item} other {{filteredItemCount} of {totalItemCount} items}}"
8187

packages/aurora/src/locales/en/messages.ts

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)