Add plural formatting for "too long" error messages when editing profile info (#7998)
* add plural formatting for profile max graphemes errors * add missing tag * simplify
This commit is contained in:
@@ -2,7 +2,7 @@ import {useCallback, useEffect, useState} from 'react'
|
|||||||
import {Dimensions, View} from 'react-native'
|
import {Dimensions, View} from 'react-native'
|
||||||
import {Image as RNImage} from 'react-native-image-crop-picker'
|
import {Image as RNImage} from 'react-native-image-crop-picker'
|
||||||
import {AppBskyActorDefs} from '@atproto/api'
|
import {AppBskyActorDefs} from '@atproto/api'
|
||||||
import {msg, Trans} from '@lingui/macro'
|
import {msg, Plural, Trans} from '@lingui/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
|
|
||||||
import {compressIfNeeded} from '#/lib/media/manip'
|
import {compressIfNeeded} from '#/lib/media/manip'
|
||||||
@@ -332,8 +332,11 @@ function DialogInner({
|
|||||||
]}
|
]}
|
||||||
label={_(msg`Display name is too long`)}>
|
label={_(msg`Display name is too long`)}>
|
||||||
<Trans>
|
<Trans>
|
||||||
Display name is too long. The maximum number of characters is{' '}
|
Display name is too long.{' '}
|
||||||
{DISPLAY_NAME_MAX_GRAPHEMES}.
|
<Plural
|
||||||
|
value={DISPLAY_NAME_MAX_GRAPHEMES}
|
||||||
|
other="The maximum number of characters is #."
|
||||||
|
/>
|
||||||
</Trans>
|
</Trans>
|
||||||
</TextField.SuffixText>
|
</TextField.SuffixText>
|
||||||
)}
|
)}
|
||||||
@@ -363,8 +366,11 @@ function DialogInner({
|
|||||||
]}
|
]}
|
||||||
label={_(msg`Description is too long`)}>
|
label={_(msg`Description is too long`)}>
|
||||||
<Trans>
|
<Trans>
|
||||||
Description is too long. The maximum number of characters is{' '}
|
Description is too long.{' '}
|
||||||
{DESCRIPTION_MAX_GRAPHEMES}.
|
<Plural
|
||||||
|
value={DESCRIPTION_MAX_GRAPHEMES}
|
||||||
|
other="The maximum number of characters is #."
|
||||||
|
/>
|
||||||
</Trans>
|
</Trans>
|
||||||
</TextField.SuffixText>
|
</TextField.SuffixText>
|
||||||
)}
|
)}
|
||||||
|
|||||||
Reference in New Issue
Block a user