From ce37561e10956c62e1e61618c9bac551ed8f3b7a Mon Sep 17 00:00:00 2001 From: Samuel Carvalho Santos Date: Tue, 16 Jun 2020 12:31:25 -0300 Subject: [PATCH] UX: Improve revert label in post history modal (#10038) --- app/assets/javascripts/discourse/app/controllers/history.js | 5 +++++ .../javascripts/discourse/app/templates/modal/history.hbs | 2 +- config/locales/client.en.yml | 2 +- config/locales/client.pt_BR.yml | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/discourse/app/controllers/history.js b/app/assets/javascripts/discourse/app/controllers/history.js index 4ed3da9b801..b2bbe94d0fa 100644 --- a/app/assets/javascripts/discourse/app/controllers/history.js +++ b/app/assets/javascripts/discourse/app/controllers/history.js @@ -60,6 +60,11 @@ export default Controller.extend(ModalFunctionality, { ); }, + @discourseComputed("previousVersion") + revertToRevisionText(revision) { + return I18n.t("post.revisions.controls.revert", { revision }); + }, + refresh(postId, postVersion) { this.set("loading", true); diff --git a/app/assets/javascripts/discourse/app/templates/modal/history.hbs b/app/assets/javascripts/discourse/app/templates/modal/history.hbs index 528f5a8bf3f..f86f98a0462 100644 --- a/app/assets/javascripts/discourse/app/templates/modal/history.hbs +++ b/app/assets/javascripts/discourse/app/templates/modal/history.hbs @@ -128,7 +128,7 @@ {{/if}} {{#if displayRevert}} - {{d-button action=(action "revertToVersion") icon="undo" label="post.revisions.controls.revert" class="btn-danger" disabled=loading}} + {{d-button action=(action "revertToVersion") icon="undo" translatedLabel=revertToRevisionText class="btn-danger" disabled=loading}} {{/if}} {{#if displayHide}} diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index 56088fe45c9..2f3a8b00957 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -2745,7 +2745,7 @@ en: last: "Last revision" hide: "Hide revision" show: "Show revision" - revert: "Revert to this revision" + revert: "Revert to revision %{revision}" edit_wiki: "Edit Wiki" edit_post: "Edit Post" comparing_previous_to_current_out_of_total: "%{previous} %{icon} %{current} / %{total}" diff --git a/config/locales/client.pt_BR.yml b/config/locales/client.pt_BR.yml index 7f6419e7c1d..4db38a182e4 100644 --- a/config/locales/client.pt_BR.yml +++ b/config/locales/client.pt_BR.yml @@ -2476,7 +2476,7 @@ pt_BR: last: "Última revisão" hide: "Esconder revisão" show: "Exibir revisão" - revert: "Reverter para esta revisão" + revert: "Reverter para a revisão %{revision}" edit_wiki: "Editar Wiki" edit_post: "Editar Postagem" comparing_previous_to_current_out_of_total: "%{previous} %{icon} %{current} / %{total}"