Add plural formatting for several strings (#9576)
This commit is contained in:
@@ -13,7 +13,7 @@ import {
|
|||||||
AtUri,
|
AtUri,
|
||||||
type RichText as RichTextAPI,
|
type RichText as RichTextAPI,
|
||||||
} from '@atproto/api'
|
} from '@atproto/api'
|
||||||
import {msg} from '@lingui/macro'
|
import {msg, plural} from '@lingui/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
import {useNavigation} from '@react-navigation/native'
|
import {useNavigation} from '@react-navigation/native'
|
||||||
|
|
||||||
@@ -384,9 +384,8 @@ let PostMenuItems = ({
|
|||||||
if (e instanceof MaxHiddenRepliesError) {
|
if (e instanceof MaxHiddenRepliesError) {
|
||||||
Toast.show(
|
Toast.show(
|
||||||
_(
|
_(
|
||||||
msg({
|
plural(MAX_HIDDEN_REPLIES, {
|
||||||
message: `You can hide a maximum of ${MAX_HIDDEN_REPLIES} replies.`,
|
other: 'You can hide a maximum of # replies.',
|
||||||
context: 'toast',
|
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React, {useRef} from 'react'
|
import React, {useRef} from 'react'
|
||||||
import {type TextInput, View} from 'react-native'
|
import {type TextInput, View} from 'react-native'
|
||||||
import {msg, Trans} from '@lingui/macro'
|
import {msg, Plural, Trans} from '@lingui/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
import * as EmailValidator from 'email-validator'
|
import * as EmailValidator from 'email-validator'
|
||||||
import type tldts from 'tldts'
|
import type tldts from 'tldts'
|
||||||
@@ -312,15 +312,15 @@ export function StepInfo({
|
|||||||
<Admonition.Content>
|
<Admonition.Content>
|
||||||
<Admonition.Text>
|
<Admonition.Text>
|
||||||
{!isOverAppMinAccessAge ? (
|
{!isOverAppMinAccessAge ? (
|
||||||
<Trans>
|
<Plural
|
||||||
You must be {MIN_ACCESS_AGE} years of age or older
|
value={MIN_ACCESS_AGE}
|
||||||
to create an account.
|
other="You must be # years of age or older to create an account."
|
||||||
</Trans>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<Trans>
|
<Plural
|
||||||
You must be {aaRegionConfig.minAccessAge} years of
|
value={aaRegionConfig.minAccessAge}
|
||||||
age or older to create an account in your region.
|
other="You must be # years of age or older to create an account in your region."
|
||||||
</Trans>
|
/>
|
||||||
)}
|
)}
|
||||||
</Admonition.Text>
|
</Admonition.Text>
|
||||||
{IS_NATIVE &&
|
{IS_NATIVE &&
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import {useCallback, useState} from 'react'
|
import {useCallback, useState} from 'react'
|
||||||
import {Keyboard, type StyleProp, View, type ViewStyle} from 'react-native'
|
import {Keyboard, type StyleProp, View, type ViewStyle} from 'react-native'
|
||||||
import {msg, Trans} from '@lingui/macro'
|
import {msg, Plural, Trans} from '@lingui/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
|
|
||||||
import {MAX_ALT_TEXT} from '#/lib/constants'
|
import {MAX_ALT_TEXT} from '#/lib/constants'
|
||||||
@@ -134,7 +134,10 @@ function SubtitleDialogInner({
|
|||||||
a.leading_snug,
|
a.leading_snug,
|
||||||
a.mt_md,
|
a.mt_md,
|
||||||
]}>
|
]}>
|
||||||
<Trans>Alt text must be less than {MAX_ALT_TEXT} characters.</Trans>
|
<Plural
|
||||||
|
value={MAX_ALT_TEXT}
|
||||||
|
other="Alt text must be less than # characters."
|
||||||
|
/>
|
||||||
</Text>
|
</Text>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user