From 32c438387bba973ef5f823df5edc29250ccf4f32 Mon Sep 17 00:00:00 2001 From: chapoi <101828855+chapoi@users.noreply.github.com> Date: Tue, 26 Dec 2023 14:37:32 +0200 Subject: [PATCH] UX: make sidebar title static (#25040) * UX: make sidebar title static * tests --- .../javascripts/discourse/app/widgets/sidebar-toggle.js | 4 +--- .../discourse/tests/acceptance/sidebar-user-test.js | 4 ++-- config/locales/client.en.yml | 3 +-- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/app/assets/javascripts/discourse/app/widgets/sidebar-toggle.js b/app/assets/javascripts/discourse/app/widgets/sidebar-toggle.js index 45e4699a1ab..ae4305c763a 100644 --- a/app/assets/javascripts/discourse/app/widgets/sidebar-toggle.js +++ b/app/assets/javascripts/discourse/app/widgets/sidebar-toggle.js @@ -7,9 +7,7 @@ export default createWidget("sidebar-toggle", { const attrs = this.attrs; return [ this.attach("button", { - title: attrs.showSidebar - ? "sidebar.hide_sidebar" - : "sidebar.show_sidebar", + title: "sidebar.title", icon: "bars", action: this.site.narrowDesktopView ? "toggleHamburger" diff --git a/app/assets/javascripts/discourse/tests/acceptance/sidebar-user-test.js b/app/assets/javascripts/discourse/tests/acceptance/sidebar-user-test.js index e75c7bfde10..e7487e74018 100644 --- a/app/assets/javascripts/discourse/tests/acceptance/sidebar-user-test.js +++ b/app/assets/javascripts/discourse/tests/acceptance/sidebar-user-test.js @@ -218,7 +218,7 @@ acceptance( assert.strictEqual( query(".btn-sidebar-toggle").title, - I18n.t("sidebar.hide_sidebar"), + I18n.t("sidebar.title"), "has the right title attribute when sidebar is expanded" ); @@ -233,7 +233,7 @@ acceptance( assert.strictEqual( query(".btn-sidebar-toggle").title, - I18n.t("sidebar.show_sidebar"), + I18n.t("sidebar.title"), "has the right title attribute when sidebar is collapsed" ); }); diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index 63124c40c6e..1010498f5ea 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -4475,8 +4475,7 @@ en: redirect_after_success: "Second factor authentication is successful. Redirecting to the previous pageā€¦" sidebar: - show_sidebar: "Show sidebar" - hide_sidebar: "Hide sidebar" + title: "Sidebar" unread_count: one: "%{count} unread" other: "%{count} unread"