FIX: small bug with topics and my posts translations (#22179)
1. `everything` was changed to `topics` 2. Path for my posts translation is `sidebar.sections.community.links.my_posts.content` not `sidebar.sections.community.links.my/posts.content`
This commit is contained in:
parent
cbb9396353
commit
8837ee4b39
|
@ -40,7 +40,7 @@ export default class EverythingSectionLink extends BaseSectionLink {
|
||||||
}
|
}
|
||||||
|
|
||||||
get title() {
|
get title() {
|
||||||
return I18n.t("sidebar.sections.community.links.everything.title");
|
return I18n.t("sidebar.sections.community.links.topics.title");
|
||||||
}
|
}
|
||||||
|
|
||||||
get text() {
|
get text() {
|
||||||
|
|
|
@ -74,7 +74,7 @@ export default class MyPostsSectionLink extends BaseSectionLink {
|
||||||
return I18n.t(
|
return I18n.t(
|
||||||
`sidebar.sections.community.links.${this.overridenName
|
`sidebar.sections.community.links.${this.overridenName
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
.replace(" ", "/")}.content`,
|
.replace(" ", "_")}.content`,
|
||||||
{ defaultValue: this.overridenName }
|
{ defaultValue: this.overridenName }
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,4 +89,32 @@ describe "Viewing sidebar", type: :system do
|
||||||
expect(header_dropdown).to be_visible
|
expect(header_dropdown).to be_visible
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe "Community sidebar section", type: :system do
|
||||||
|
fab!(:user) { Fabricate(:user, locale: "pl_PL") }
|
||||||
|
fab!(:translation_override) do
|
||||||
|
TranslationOverride.create!(
|
||||||
|
locale: "pl_PL",
|
||||||
|
translation_key: "js.sidebar.sections.community.links.topics.content",
|
||||||
|
value: "Tematy",
|
||||||
|
)
|
||||||
|
TranslationOverride.create!(
|
||||||
|
locale: "pl_PL",
|
||||||
|
translation_key: "js.sidebar.sections.community.links.topics.title",
|
||||||
|
value: "Wszystkie tematy",
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
before { SiteSetting.allow_user_locale = true }
|
||||||
|
|
||||||
|
it "has correct translations" do
|
||||||
|
sign_in user
|
||||||
|
visit("/latest")
|
||||||
|
links = page.all("#sidebar-section-content-community .sidebar-section-link-wrapper a")
|
||||||
|
expect(links.map(&:text)).to eq(%w[Tematy Wysłane])
|
||||||
|
expect(links.map { |link| link[:title] }).to eq(
|
||||||
|
["Wszystkie tematy", "Moja ostatnia aktywność w temacie"],
|
||||||
|
)
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue