Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add plural formatting for alt text truncated string (#7994)

* add plural formatting in GifAltText.tsx

* add plural formatting in ImageAltTextDialog.tsx

* import Plural

* format

authored by

surfdude29 and committed by
GitHub
758cb731 5130f932

+12 -6
+6 -3
src/view/com/composer/GifAltText.tsx
··· 1 1 import {useState} from 'react' 2 2 import {TouchableOpacity, 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 6 6 import {HITSLOP_10, MAX_ALT_TEXT} from '#/lib/constants' ··· 177 177 t.atoms.text_contrast_medium, 178 178 ]}> 179 179 <Trans> 180 - Alt text will be truncated. Limit:{' '} 181 - {i18n.number(MAX_ALT_TEXT)} characters. 180 + Alt text will be truncated.{' '} 181 + <Plural 182 + value={MAX_ALT_TEXT} 183 + other={`Limit: ${i18n.number(MAX_ALT_TEXT)} characters.`} 184 + /> 182 185 </Trans> 183 186 </Text> 184 187 </View>
+6 -3
src/view/com/composer/photos/ImageAltTextDialog.tsx
··· 1 1 import React from 'react' 2 2 import {ImageStyle, useWindowDimensions, View} from 'react-native' 3 3 import {Image} from 'expo-image' 4 - import {msg, Trans} from '@lingui/macro' 4 + import {msg, Plural, Trans} from '@lingui/macro' 5 5 import {useLingui} from '@lingui/react' 6 6 7 7 import {MAX_ALT_TEXT} from '#/lib/constants' ··· 137 137 t.atoms.text_contrast_medium, 138 138 ]}> 139 139 <Trans> 140 - Alt text will be truncated. Limit: {i18n.number(MAX_ALT_TEXT)}{' '} 141 - characters. 140 + Alt text will be truncated.{' '} 141 + <Plural 142 + value={MAX_ALT_TEXT} 143 + other={`Limit: ${i18n.number(MAX_ALT_TEXT)} characters.`} 144 + /> 142 145 </Trans> 143 146 </Text> 144 147 </View>