Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IMPROVE] i18n of threads and discussion buttons #14334

Merged
merged 1 commit into from
Apr 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 🎉"
}
}