DEV: Add dedicated translations for links in sidebar

We do not want to depend on existing translations which are used
elsewhere and can break the sidebar experience when changed.
This commit is contained in:
Alan Guo Xiang Tan 2022-08-24 13:23:12 +08:00
parent eb12daa7f8
commit 7f198bd975
6 changed files with 19 additions and 11 deletions

View File

@ -12,10 +12,10 @@ export default class AboutSectionLink extends BaseSectionLink {
}
get title() {
return I18n.t("about.simple_title");
return I18n.t("sidebar.sections.community.links.about.content");
}
get text() {
return I18n.t("about.simple_title");
return I18n.t("sidebar.sections.community.links.about.content");
}
}

View File

@ -12,10 +12,10 @@ export default class BadgesSectionLink extends BaseSectionLink {
}
get title() {
return I18n.t("badges.title");
return I18n.t("sidebar.sections.community.links.badges.content");
}
get text() {
return I18n.t("badges.title");
return I18n.t("sidebar.sections.community.links.badges.content");
}
}

View File

@ -16,10 +16,10 @@ export default class FAQSectionLink extends BaseSectionLink {
}
get title() {
return I18n.t("faq");
return I18n.t("sidebar.sections.community.links.faq.content");
}
get text() {
return I18n.t("faq");
return I18n.t("sidebar.sections.community.links.faq.content");
}
}

View File

@ -12,10 +12,10 @@ export default class AdminSectionLink extends BaseSectionLink {
}
get title() {
return I18n.t("admin_title");
return I18n.t("sidebar.sections.community.links.admin.content");
}
get text() {
return I18n.t("admin_title");
return I18n.t("sidebar.sections.community.links.admin.content");
}
}

View File

@ -32,13 +32,13 @@ acceptance("Sidebar - Anonymous user - Community Section", function (needs) {
assert.strictEqual(
sectionLinks[2].textContent.trim(),
I18n.t("about.simple_title"),
I18n.t("sidebar.sections.community.links.about.content"),
"displays the about section link third"
);
assert.strictEqual(
sectionLinks[3].textContent.trim(),
I18n.t("faq"),
I18n.t("sidebar.sections.community.links.faq.content"),
"displays the FAQ section link last"
);
});
@ -62,7 +62,7 @@ acceptance("Sidebar - Anonymous user - Community Section", function (needs) {
assert.strictEqual(
sectionLinks[1].textContent.trim(),
I18n.t("badges.title"),
I18n.t("sidebar.sections.community.links.badges.content"),
"displays the badges section link second"
);
});

View File

@ -4120,9 +4120,17 @@ en:
header_link_text: "Community"
header_action_title: "create a new topic"
links:
about:
content: "About"
admin:
content: "Admin"
badges:
content: "Badges"
everything:
content: "Everything"
title: "All topics"
faq:
content: "FAQ"
tracked:
content: "Tracked"
title: "All tracked topics"