Bluesky app fork with some witchin' additions 💫

Add plural formatting for several strings (#9576)

authored by

surfdude29 and committed by
GitHub
3b9f0b0a a6ba0810

+17 -15
+3 -4
src/components/PostControls/PostMenu/PostMenuItems.tsx
··· 13 13 AtUri, 14 14 type RichText as RichTextAPI, 15 15 } from '@atproto/api' 16 - import {msg} from '@lingui/macro' 16 + import {msg, plural} from '@lingui/macro' 17 17 import {useLingui} from '@lingui/react' 18 18 import {useNavigation} from '@react-navigation/native' 19 19 ··· 384 384 if (e instanceof MaxHiddenRepliesError) { 385 385 Toast.show( 386 386 _( 387 - msg({ 388 - message: `You can hide a maximum of ${MAX_HIDDEN_REPLIES} replies.`, 389 - context: 'toast', 387 + plural(MAX_HIDDEN_REPLIES, { 388 + other: 'You can hide a maximum of # replies.', 390 389 }), 391 390 ), 392 391 )
+9 -9
src/screens/Signup/StepInfo/index.tsx
··· 1 1 import React, {useRef} from 'react' 2 2 import {type TextInput, View} from 'react-native' 3 - import {msg, Trans} from '@lingui/macro' 3 + import {msg, Plural, Trans} from '@lingui/macro' 4 4 import {useLingui} from '@lingui/react' 5 5 import * as EmailValidator from 'email-validator' 6 6 import type tldts from 'tldts' ··· 312 312 <Admonition.Content> 313 313 <Admonition.Text> 314 314 {!isOverAppMinAccessAge ? ( 315 - <Trans> 316 - You must be {MIN_ACCESS_AGE} years of age or older 317 - to create an account. 318 - </Trans> 315 + <Plural 316 + value={MIN_ACCESS_AGE} 317 + other="You must be # years of age or older to create an account." 318 + /> 319 319 ) : ( 320 - <Trans> 321 - You must be {aaRegionConfig.minAccessAge} years of 322 - age or older to create an account in your region. 323 - </Trans> 320 + <Plural 321 + value={aaRegionConfig.minAccessAge} 322 + other="You must be # years of age or older to create an account in your region." 323 + /> 324 324 )} 325 325 </Admonition.Text> 326 326 {IS_NATIVE &&
+5 -2
src/view/com/composer/videos/SubtitleDialog.tsx
··· 1 1 import {useCallback, useState} from 'react' 2 2 import {Keyboard, type StyleProp, View, type ViewStyle} from 'react-native' 3 - import {msg, Trans} from '@lingui/macro' 3 + import {msg, Plural, Trans} from '@lingui/macro' 4 4 import {useLingui} from '@lingui/react' 5 5 6 6 import {MAX_ALT_TEXT} from '#/lib/constants' ··· 134 134 a.leading_snug, 135 135 a.mt_md, 136 136 ]}> 137 - <Trans>Alt text must be less than {MAX_ALT_TEXT} characters.</Trans> 137 + <Plural 138 + value={MAX_ALT_TEXT} 139 + other="Alt text must be less than # characters." 140 + /> 138 141 </Text> 139 142 )} 140 143