diff options
author | surfdude29 <149612116+surfdude29@users.noreply.github.com> | 2025-04-02 00:09:53 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-01 16:09:53 -0700 |
commit | 758cb731f05736895402860a5b8253278a356045 (patch) | |
tree | 172301bf2c4fc0942d2cc358ebd084610c200977 /src | |
parent | 5130f932edc77774a19ba0b2020c87a31f4c0c58 (diff) | |
download | voidsky-758cb731f05736895402860a5b8253278a356045.tar.zst |
Add plural formatting for alt text truncated string (#7994)
* add plural formatting in GifAltText.tsx * add plural formatting in ImageAltTextDialog.tsx * import Plural * format
Diffstat (limited to 'src')
-rw-r--r-- | src/view/com/composer/GifAltText.tsx | 9 | ||||
-rw-r--r-- | src/view/com/composer/photos/ImageAltTextDialog.tsx | 9 |
2 files changed, 12 insertions, 6 deletions
diff --git a/src/view/com/composer/GifAltText.tsx b/src/view/com/composer/GifAltText.tsx index bd99b9f28..4d2539c4e 100644 --- a/src/view/com/composer/GifAltText.tsx +++ b/src/view/com/composer/GifAltText.tsx @@ -1,6 +1,6 @@ import {useState} from 'react' import {TouchableOpacity, View} from 'react-native' -import {msg, Trans} from '@lingui/macro' +import {msg, Plural, Trans} from '@lingui/macro' import {useLingui} from '@lingui/react' import {HITSLOP_10, MAX_ALT_TEXT} from '#/lib/constants' @@ -177,8 +177,11 @@ function AltTextInner({ t.atoms.text_contrast_medium, ]}> <Trans> - Alt text will be truncated. Limit:{' '} - {i18n.number(MAX_ALT_TEXT)} characters. + Alt text will be truncated.{' '} + <Plural + value={MAX_ALT_TEXT} + other={`Limit: ${i18n.number(MAX_ALT_TEXT)} characters.`} + /> </Trans> </Text> </View> diff --git a/src/view/com/composer/photos/ImageAltTextDialog.tsx b/src/view/com/composer/photos/ImageAltTextDialog.tsx index aa0b0987a..c0ce32af3 100644 --- a/src/view/com/composer/photos/ImageAltTextDialog.tsx +++ b/src/view/com/composer/photos/ImageAltTextDialog.tsx @@ -1,7 +1,7 @@ import React from 'react' import {ImageStyle, useWindowDimensions, View} from 'react-native' import {Image} from 'expo-image' -import {msg, Trans} from '@lingui/macro' +import {msg, Plural, Trans} from '@lingui/macro' import {useLingui} from '@lingui/react' import {MAX_ALT_TEXT} from '#/lib/constants' @@ -137,8 +137,11 @@ const ImageAltTextInner = ({ t.atoms.text_contrast_medium, ]}> <Trans> - Alt text will be truncated. Limit: {i18n.number(MAX_ALT_TEXT)}{' '} - characters. + Alt text will be truncated.{' '} + <Plural + value={MAX_ALT_TEXT} + other={`Limit: ${i18n.number(MAX_ALT_TEXT)} characters.`} + /> </Trans> </Text> </View> |