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