fix: Update the translation for the text used in isTyping method (#10384)
This fix consists of translating the message when another user is typing on the other side. --- Co-authored-by: Pranav <pranavrajs@gmail.com> Co-authored-by: Pranav <pranav@chatwoot.com>
This commit is contained in:
@@ -27,19 +27,20 @@ export const isJSONValid = value => {
|
||||
|
||||
export const getTypingUsersText = (users = []) => {
|
||||
const count = users.length;
|
||||
const [firstUser, secondUser] = users;
|
||||
|
||||
if (count === 1) {
|
||||
const [user] = users;
|
||||
return `${user.name} is typing`;
|
||||
return ['TYPING.ONE', { user: firstUser.name }];
|
||||
}
|
||||
|
||||
if (count === 2) {
|
||||
const [first, second] = users;
|
||||
return `${first.name} and ${second.name} are typing`;
|
||||
return [
|
||||
'TYPING.TWO',
|
||||
{ user: firstUser.name, secondUser: secondUser.name },
|
||||
];
|
||||
}
|
||||
|
||||
const [user] = users;
|
||||
const rest = users.length - 1;
|
||||
return `${user.name} and ${rest} others are typing`;
|
||||
return ['TYPING.MULTIPLE', { user: firstUser.name, count: count - 1 }];
|
||||
};
|
||||
|
||||
export const createPendingMessage = data => {
|
||||
|
||||
Reference in New Issue
Block a user