diff options
| author | Armand Philippot <git@armandphilippot.com> | 2022-01-29 18:21:37 +0100 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2022-01-29 19:02:57 +0100 |
| commit | e4d5b8151802517b2943756fc0d09ffa95e2c4e2 (patch) | |
| tree | 9e99137a7b64ea7993a8311a7162336a551be8b2 /src/components/PaginationCursor | |
| parent | 47b854de26dea24e7838fd0804df103dee99635f (diff) | |
chore: replace lingui functions with react-intl
Diffstat (limited to 'src/components/PaginationCursor')
| -rw-r--r-- | src/components/PaginationCursor/PaginationCursor.tsx | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/src/components/PaginationCursor/PaginationCursor.tsx b/src/components/PaginationCursor/PaginationCursor.tsx index bcbb555..a8c6265 100644 --- a/src/components/PaginationCursor/PaginationCursor.tsx +++ b/src/components/PaginationCursor/PaginationCursor.tsx @@ -1,4 +1,4 @@ -import { plural, t } from '@lingui/macro'; +import { useIntl } from 'react-intl'; import styles from './PaginationCursor.module.scss'; const PaginationCursor = ({ @@ -8,6 +8,8 @@ const PaginationCursor = ({ current: number; total: number; }) => { + const intl = useIntl(); + return ( <div className={styles.wrapper}> <progress @@ -16,12 +18,19 @@ const PaginationCursor = ({ value={current} aria-valuemin={0} aria-valuemax={total} - aria-label={t`Number of articles loaded out of the total available.`} - title={plural(current, { - zero: `# articles out of a total of ${total}`, - one: `# article out of a total of ${total}`, - other: `# articles out of a total of ${total}`, + aria-label={intl.formatMessage({ + defaultMessage: + 'Number of articles loaded out of the total available.', + description: 'PaginationCursor: loaded articles count aria-label', })} + title={intl.formatMessage( + { + defaultMessage: + '{articlesCount, plural, =0 {# articles} one {# article} other {# articles}} out of a total of {total}', + description: 'PaginationCursor: loaded articles count message', + }, + { articlesCount: current, total } + )} ></progress> </div> ); |
