Skip to content

Commit

Permalink
Improve i18n of threads and discussion buttons (#14334)
Browse files Browse the repository at this point in the history
  • Loading branch information
sampaiodiego authored and rodrigok committed Apr 30, 2019
1 parent f6ca356 commit 376c85a
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
4 changes: 2 additions & 2 deletions app/ui-message/client/message.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
{{#if $gt msg.dcount 0}}
<button class="js-navigate-to-discussion rc-button rc-button--primary rc-button--small" data-rid={{roomId}}>
<!-- {{> icon icon="discussion"}} -->
<span class='reply-counter'>{{msg.dcount}}</span>&nbsp;{{_ i18nKeyMessage}}
<span>{{{_ 'message_counter' counter=i18nDiscussionCounter count=msg.dcount }}}</span>
</button>
{{else}}
<button class="js-navigate-to-discussion rc-button rc-button--primary rc-button--small no-replies" data-rid={{roomId}}>
Expand All @@ -105,7 +105,7 @@
<div class="message-discussion">
<button class="js-open-thread rc-button rc-button--primary rc-button--small" data-rid={{roomId}}>
{{> icon icon="thread"}}
<span class='reply-counter'>{{msg.tcount}}</span>&nbsp;{{_ i18nKeyReply}}
<span>{{{_ 'reply_counter' counter=i18nReplyCounter count=msg.tcount }}}</span>
</button>
<span class="discussion-reply-lm">{{ formatDateAndTime msg.tlm}}</span>
</div>
Expand Down
12 changes: 4 additions & 8 deletions app/ui-message/client/message.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,13 @@ Template.message.helpers({
and(a, b) {
return a && b;
},
i18nKeyMessage() {
i18nReplyCounter() {
const { msg } = this;
return msg.dcount > 1
? 'messages'
: 'message';
return `<span class='reply-counter'>${ msg.tcount }</span>`;
},
i18nKeyReply() {
i18nDiscussionCounter() {
const { msg } = this;
return msg.tcount > 1
? 'replies'
: 'reply';
return `<span class='reply-counter'>${ msg.dcount }</span>`;
},
formatDateAndTime,
encodeURI(text) {
Expand Down
8 changes: 6 additions & 2 deletions packages/rocketchat-i18n/i18n/en.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -1993,6 +1993,8 @@
"Message_AudioRecorderEnabled_Description": "Requires 'audio/mp3' files to be an accepted media type within 'File Upload' settings.",
"Message_BadWordsFilterList": "Add Bad Words to the Blacklist",
"Message_BadWordsFilterListDescription": "Add List of Comma-separated list of bad words to filter",
"message_counter": "__counter__ message",
"message_counter_plural": "__counter__ messages",
"Message_DateFormat": "Date Format",
"Message_DateFormat_Description": "See also: <a href=\"http://momentjs.com/docs/#/displaying/format/\" target=\"momemt\">Moment.js</a>",
"Message_deleting_blocked": "This message cannot be deleted anymore",
Expand Down Expand Up @@ -2426,8 +2428,10 @@
"Removed": "Removed",
"Removed_User": "Removed User",
"Replied_on": "Replied on",
"Replies": "Replies",
"Reply": "Reply",
"reply_counter": "__counter__ reply",
"reply_counter_plural": "__counter__ replies",
"Replies": "Replies",
"Reply_in_thread": "Reply in Thread",
"Reply_in_direct_message": "Reply in Direct Message",
"ReplyTo": "Reply-To",
Expand Down Expand Up @@ -3242,4 +3246,4 @@
"Your_question": "Your question",
"Your_server_link": "Your server link",
"Your_workspace_is_ready": "Your workspace is ready to use 🎉"
}
}
6 changes: 5 additions & 1 deletion packages/rocketchat-i18n/i18n/pt-BR.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -1957,6 +1957,8 @@
"Message_AudioRecorderEnabled_Description": "Requer arquivos 'audio / mp3' para ser um tipo de mídia aceito dentro das configurações 'Upload de arquivo'.",
"Message_BadWordsFilterList": "Adicione palavrões para a lista negra",
"Message_BadWordsFilterListDescription": "Adicione palavrões separados por vírgula para filtrar",
"message_counter": "__counter__ mensagem",
"message_counter_plural": "__counter__ mensagens",
"Message_DateFormat": "Formato de Data",
"Message_DateFormat_Description": "Veja também: <a href=\"http://momentjs.com/docs/#/displaying/format/\" target=\"momemt\">Moment.js</a>",
"Message_deleting_blocked": "Esta mensagem não pode ser mais apagada",
Expand Down Expand Up @@ -2380,6 +2382,8 @@
"Removed_User": "Usuário removido",
"Replies": "Respostas",
"Reply": "Responder",
"reply_counter": "__counter__ reposta",
"reply_counter_plural": "__counter__ respostas",
"ReplyTo": "Responder para",
"Report_Abuse": "Denunciar abuso",
"Report_exclamation_mark": "Relatar!",
Expand Down Expand Up @@ -3174,4 +3178,4 @@
"Your_question": "A sua pergunta",
"Your_server_link": "O link do seu servidor",
"Your_workspace_is_ready": "O seu espaço de trabalho está pronto a usar 🎉"
}
}

0 comments on commit 376c85a

Please sign in to comment.