Improve translation output

This commit is contained in:
Eric Bailey
2024-07-23 16:10:49 -05:00
parent d7426d45e2
commit 412a0489d6
+18 -12
View File
@@ -417,11 +417,6 @@ function MutedWordRow({
const control = Prompt.usePromptControl() const control = Prompt.usePromptControl()
const expiryDate = word.expiresAt ? new Date(word.expiresAt) : undefined const expiryDate = word.expiresAt ? new Date(word.expiresAt) : undefined
const isExpired = expiryDate && expiryDate < new Date() const isExpired = expiryDate && expiryDate < new Date()
const target = word.targets.find(t => t === 'content') ? (
<Trans>text, tags</Trans>
) : (
<Trans>tags</Trans>
)
const formatDistance = useFormatDistance() const formatDistance = useFormatDistance()
const remove = React.useCallback(async () => { const remove = React.useCallback(async () => {
@@ -464,17 +459,28 @@ function MutedWordRow({
wordBreak: 'break-word', wordBreak: 'break-word',
}), }),
]}> ]}>
<Text style={[a.flex_1]}>{word.value}</Text> {word.targets.find(t => t === 'content') ? (
<Trans comment="Pattern: {wordValue} in text, tags">
{word.value}{' '}
<Text style={[a.font_normal, t.atoms.text_contrast_medium]}> <Text style={[a.font_normal, t.atoms.text_contrast_medium]}>
{' '} in{' '}
<Trans>in</Trans>{' '}
</Text>
<Text style={[a.font_bold, t.atoms.text_contrast_medium]}> <Text style={[a.font_bold, t.atoms.text_contrast_medium]}>
{target} text, tags
</Text> </Text>
</Text> </Text>
</Trans>
) : (
<Trans comment="Pattern: {wordValue} in tags">
{word.value}{' '}
<Text style={[a.font_normal, t.atoms.text_contrast_medium]}>
in{' '}
<Text style={[a.font_bold, t.atoms.text_contrast_medium]}>
tags
</Text>
</Text>
</Trans>
)}
</Text>
</View> </View>
{(expiryDate || word.actorTarget === 'exclude-following') && ( {(expiryDate || word.actorTarget === 'exclude-following') && (