From 4589e607fceb4583e4fef14be15d66cb5fea198a Mon Sep 17 00:00:00 2001 From: Gabriel Grubba Date: Tue, 11 Jun 2024 11:41:15 -0300 Subject: [PATCH] A11Y: Update labels for dropdown and sidebar --- .../bread-crumbs-right/custom-topic-lists-dropdown.gjs | 2 +- .../initializers/initializer-breadcrumbs-topic-lists.js | 2 +- config/locales/client.en.yml | 5 +++-- config/locales/server.en.yml | 5 +++-- spec/system/custom_topic_lists_spec.rb | 2 +- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/assets/javascripts/discourse/connectors/bread-crumbs-right/custom-topic-lists-dropdown.gjs b/assets/javascripts/discourse/connectors/bread-crumbs-right/custom-topic-lists-dropdown.gjs index ffbc45c..a456e87 100644 --- a/assets/javascripts/discourse/connectors/bread-crumbs-right/custom-topic-lists-dropdown.gjs +++ b/assets/javascripts/discourse/connectors/bread-crumbs-right/custom-topic-lists-dropdown.gjs @@ -9,7 +9,7 @@ export default class CustomTopicListsDropdown extends Component { comboBoxOptions = { filterable: true, - none: "custom_topic_lists_button.label", + none: "custom_topic_lists.dropdown", caretDownIcon: "caret-right", caretUpIcon: "caret-down", headerComponent: "tag-drop/tag-drop-header", diff --git a/assets/javascripts/discourse/initializers/initializer-breadcrumbs-topic-lists.js b/assets/javascripts/discourse/initializers/initializer-breadcrumbs-topic-lists.js index 3472bb7..5180ee6 100644 --- a/assets/javascripts/discourse/initializers/initializer-breadcrumbs-topic-lists.js +++ b/assets/javascripts/discourse/initializers/initializer-breadcrumbs-topic-lists.js @@ -21,7 +21,7 @@ export default { (BaseCustomSidebarSection, BaseCustomSidebarSectionLink) => { return class extends BaseCustomSidebarSection { name = "custom-topic-lists"; - text = I18n.t("custom_topic_lists_button.label"); + text = I18n.t("custom_topic_lists.sidebar"); links = customTopicsToShow.map(({ icon, name, path }) => { return new (class extends BaseCustomSidebarSectionLink { name = name; diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index 1f53cf2..2492afc 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -11,5 +11,6 @@ en: js: discourse_custom_topic_lists: placeholder: placeholder - custom_topic_lists_button: - label: "Custom lists" \ No newline at end of file + custom_topic_lists: + dropdown: "Custom lists" + sidebar: "Custom lists" \ No newline at end of file diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index 7f6d44b..e137673 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -1,3 +1,4 @@ en: - custom_topic_lists_button: - label: "Custom lists" \ No newline at end of file + custom_topic_lists: + dropdown: "Custom lists" + sidebar: "Custom lists" \ No newline at end of file diff --git a/spec/system/custom_topic_lists_spec.rb b/spec/system/custom_topic_lists_spec.rb index 3a798b8..a82150e 100644 --- a/spec/system/custom_topic_lists_spec.rb +++ b/spec/system/custom_topic_lists_spec.rb @@ -67,7 +67,7 @@ def self.add_json(*jsons) visit "/" list = find("div[data-section-name='custom-topic-lists']") - expect(list).to have_text(I18n.t("custom_topic_lists_button.label")) + expect(list).to have_text(I18n.t("custom_topic_lists.sidebar")) find("li[data-list-item-name='New questions']").click expect(page).to have_text(topic0.title)