Remove translation from message reaction tooltip

This commit is contained in:
Dylan 2022-08-15 19:40:16 +09:30
parent 07b3115eaf
commit 036070227c

View file

@ -360,24 +360,21 @@ function pickEmoji(e, roomId, eventId, roomTimeline) {
}
function genReactionMsg(userIds, reaction, shortcode) {
let i18nKey = 'Molecules.Message.user_reacted';
if (userIds.length <= 3) {
i18nKey += `_${userIds.length}`;
}
return (
<Trans
i18nKey={i18nKey}
values={{ count: userIds.length, other_count: userIds.length - 3 }}
components={{
bold: <b />,
user_one: <Twemojify text={getUsername(userIds?.[0])} />,
user_two: <Twemojify text={getUsername(userIds?.[1])} />,
user_three: <Twemojify text={getUsername(userIds?.[2])} />,
emoji: <Twemojify text={shortcode ? `:${shortcode}:` : reaction} />,
}}
/>
<>
{userIds.map((userId, index) => (
<React.Fragment key={userId}>
{twemojify(getUsername(userId))}
{index < userIds.length - 1 && (
<span style={{ opacity: '.6' }}>
{index === userIds.length - 2 ? ' and ' : ', '}
</span>
)}
</React.Fragment>
))}
<span style={{ opacity: '.6' }}>{' reacted with '}</span>
{twemojify(shortcode ? `:${shortcode}:` : reaction, { className: 'react-emoji' })}
</>
);
}