From 758cb731f05736895402860a5b8253278a356045 Mon Sep 17 00:00:00 2001 From: surfdude29 <149612116+surfdude29@users.noreply.github.com> Date: Wed, 2 Apr 2025 00:09:53 +0100 Subject: [PATCH] Add plural formatting for alt text truncated string (#7994) * add plural formatting in GifAltText.tsx * add plural formatting in ImageAltTextDialog.tsx * import Plural * format --- src/view/com/composer/GifAltText.tsx | 9 ++++++--- 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 bd99b9f28e..4d2539c4e3 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, ]}> - Alt text will be truncated. Limit:{' '} - {i18n.number(MAX_ALT_TEXT)} characters. + Alt text will be truncated.{' '} + diff --git a/src/view/com/composer/photos/ImageAltTextDialog.tsx b/src/view/com/composer/photos/ImageAltTextDialog.tsx index aa0b0987ac..c0ce32af31 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, ]}> - Alt text will be truncated. Limit: {i18n.number(MAX_ALT_TEXT)}{' '} - characters. + Alt text will be truncated.{' '} +