Skip to content

A platform for community discussion. Free, open, simple.

FIX: small bug with topics and my posts translations (#22179)

Krzysztof Kotlarek8837ee4b39cb
diff --git a/app/assets/javascripts/discourse/app/lib/sidebar/common/community-section/everything-section-link.js b/app/assets/javascripts/discourse/app/lib/sidebar/common/community-section/everything-section-link.js
index 9f1c6c5bc1e..c541ad9b0c7 100644
--- a/app/assets/javascripts/discourse/app/lib/sidebar/common/community-section/everything-section-link.js
+++ b/app/assets/javascripts/discourse/app/lib/sidebar/common/community-section/everything-section-link.js
@@ -40,7 +40,7 @@ export default class EverythingSectionLink extends BaseSectionLink {
}
get title() {
- return I18n.t("sidebar.sections.community.links.everything.title");
+ return I18n.t("sidebar.sections.community.links.topics.title");
}
get text() {
diff --git a/app/assets/javascripts/discourse/app/lib/sidebar/user/community-section/my-posts-section-link.js b/app/assets/javascripts/discourse/app/lib/sidebar/user/community-section/my-posts-section-link.js
index be002344739..cc3b9988ed1 100644
--- a/app/assets/javascripts/discourse/app/lib/sidebar/user/community-section/my-posts-section-link.js
+++ b/app/assets/javascripts/discourse/app/lib/sidebar/user/community-section/my-posts-section-link.js
@@ -74,7 +74,7 @@ export default class MyPostsSectionLink extends BaseSectionLink {
return I18n.t(
`sidebar.sections.community.links.${this.overridenName
.toLowerCase()
- .replace(" ", "/")}.content`,
+ .replace(" ", "_")}.content`,
{ defaultValue: this.overridenName }
);
}
diff --git a/spec/system/viewing_sidebar_spec.rb b/spec/system/viewing_sidebar_spec.rb
index 41044d40038..9ad545d38c0 100644
--- a/spec/system/viewing_sidebar_spec.rb
+++ b/spec/system/viewing_sidebar_spec.rb
@@ -89,4 +89,32 @@ describe "Viewing sidebar", type: :system do
expect(header_dropdown).to be_visible
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