DEV: Allow sidebar section caret title to be translated (#17491)

This commit is contained in:
Alan Guo Xiang Tan 2022-07-14 15:27:01 +08:00 committed by GitHub
parent 845642ac46
commit 737c0a7b9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 1 deletions

View File

@ -1,6 +1,6 @@
<div class={{concat "sidebar-section-wrapper sidebar-section-" @sectionName}}>
<div class="sidebar-section-header">
<button type="button" class="sidebar-section-header-caret" title="toggle section" {{on "click" this.toggleSectionDisplay}}>
<button type="button" class="sidebar-section-header-caret" title={{i18n "sidebar.toggle_section"}} {{on "click" this.toggleSectionDisplay}}>
{{d-icon this.headerCaretIcon}}
</button>

View File

@ -1,3 +1,5 @@
import I18n from "I18n";
import { test } from "qunit";
import { click, currentURL, settled, visit } from "@ember/test-helpers";
import {
@ -64,6 +66,12 @@ acceptance("Sidebar - Topics Section", function (needs) {
"shows content section"
);
assert.strictEqual(
query(".sidebar-section-topics .sidebar-section-header-caret").title,
I18n.t("sidebar.toggle_section"),
"caret has the right title"
);
await click(".sidebar-section-topics .sidebar-section-header-caret");
assert.ok(

View File

@ -4054,6 +4054,7 @@ en:
sidebar:
unread_count: "%{count} unread"
new_count: "%{count} new"
toggle_section: "toggle section"
sections:
messages:
header_link_title: "personal messages"