From 8db377d29b31f92d4f38453087bddf20438281e6 Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Tue, 10 Oct 2023 10:51:51 +0530 Subject: [PATCH] feat: allow translation --- .../widgets/conversation/ReplyToMessage.vue | 16 +++++++++++++--- .../dashboard/i18n/locale/en/conversation.json | 5 +++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/app/javascript/dashboard/components/widgets/conversation/ReplyToMessage.vue b/app/javascript/dashboard/components/widgets/conversation/ReplyToMessage.vue index c8ad57f7c..90648585d 100644 --- a/app/javascript/dashboard/components/widgets/conversation/ReplyToMessage.vue +++ b/app/javascript/dashboard/components/widgets/conversation/ReplyToMessage.vue @@ -50,13 +50,23 @@ export default { if (this.attachments.length > 1) { if (firstFileName) { - return `${firstFileName} and ${this.attachments.length - 1} more`; + return this.$t( + 'CONVERSATION.REPLY_TO_ATTACHMENT.FILE_PLUS_MULTIPLE', + { + first: firstFileName, + count: (this.attachments.length - 1).toLocaleString(), + } + ); } - return `${this.attachments.length} files`; + return this.$t('CONVERSATION.REPLY_TO_ATTACHMENT.COUNT', { + count: this.attachments.length.toLocaleString(), + }); } - return firstFileName ?? 'Attachment'; + return ( + firstFileName ?? this.$t('CONVERSATION.REPLY_TO_ATTACHMENT.ATTACHMENT') + ); }, }, }; diff --git a/app/javascript/dashboard/i18n/locale/en/conversation.json b/app/javascript/dashboard/i18n/locale/en/conversation.json index 9d748f6c3..cce60b541 100644 --- a/app/javascript/dashboard/i18n/locale/en/conversation.json +++ b/app/javascript/dashboard/i18n/locale/en/conversation.json @@ -47,6 +47,11 @@ "RATING_TITLE": "Rating", "FEEDBACK_TITLE": "Feedback", "REPLY_MESSAGE_NOT_FOUND": "Not available, click to scroll to the message", + "REPLY_TO_ATTACHMENT": { + "FILE_PLUS_MULTIPLE": "%{first} and %{count} others", + "COUNT": "%{count} files", + "ATTACHMENT": "Attachment" + }, "CARD": { "SHOW_LABELS": "Show labels", "HIDE_LABELS": "Hide labels"