Skip to content

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

FIX: Also show the toggle localization button on mobile (#32912)

Natalie Tay5cb19734e087
diff --git a/app/assets/javascripts/discourse/app/components/topic-timeline/container.gjs b/app/assets/javascripts/discourse/app/components/topic-timeline/container.gjs
index 197c36af585..8b020a938df 100644
--- a/app/assets/javascripts/discourse/app/components/topic-timeline/container.gjs
+++ b/app/assets/javascripts/discourse/app/components/topic-timeline/container.gjs
@@ -10,7 +10,6 @@ import { and, not, or } from "truth-helpers";
import DButton from "discourse/components/d-button";
import PluginOutlet from "discourse/components/plugin-outlet";
import TopicAdminMenu from "discourse/components/topic-admin-menu";
-import TopicLocalizedContentToggle from "discourse/components/topic-localized-content-toggle";
import UserTip from "discourse/components/user-tip";
import ageWithTooltip from "discourse/helpers/age-with-tooltip";
import categoryLink from "discourse/helpers/category-link";
@@ -161,13 +160,6 @@ export default class TopicTimelineScrollArea extends Component {
return true;
}
- get displayLocalizationToggle() {
- return (
- this.siteSettings.experimental_content_localization &&
- this.args.model.has_localized_content
- );
- }
-
get canCreatePost() {
return this.args.model.details?.can_create_post;
}
@@ -551,10 +543,6 @@ export default class TopicTimelineScrollArea extends Component {
@outletArgs={{lazyHash model=@model}}
/>
- {{#if this.displayLocalizationToggle}}
- <TopicLocalizedContentToggle @topic={{@model}} />
- {{/if}}
-
<TopicAdminMenu
@topic={{@model}}
@toggleMultiSelect={{@toggleMultiSelect}}
diff --git a/app/assets/javascripts/discourse/app/templates/topic.gjs b/app/assets/javascripts/discourse/app/templates/topic.gjs
index 42fc196f5dc..7a93f6dcc77 100644
--- a/app/assets/javascripts/discourse/app/templates/topic.gjs
+++ b/app/assets/javascripts/discourse/app/templates/topic.gjs
@@ -27,6 +27,7 @@ import TextField from "discourse/components/text-field";
import TopicAdminMenu from "discourse/components/topic-admin-menu";
import TopicCategory from "discourse/components/topic-category";
import TopicFooterButtons from "discourse/components/topic-footer-buttons";
+import TopicLocalizedContentToggle from "discourse/components/topic-localized-content-toggle";
import TopicMap from "discourse/components/topic-map/index";
import TopicNavigation from "discourse/components/topic-navigation";
import TopicProgress from "discourse/components/topic-progress";
@@ -339,6 +340,11 @@ export default RouteTemplate(
topicProgressExpanded=info.topicProgressExpanded
}}
/>
+
+ {{#if @controller.model.has_localized_content}}
+ <TopicLocalizedContentToggle @topic={{@controller.model}} />
+ {{/if}}
+
{{#if info.renderTimeline}}
<TopicTimeline
@info={{info}}
diff --git a/app/assets/stylesheets/common/base/topic.scss b/app/assets/stylesheets/common/base/topic.scss
index 8b066d94df2..6b512c0d3fe 100644
--- a/app/assets/stylesheets/common/base/topic.scss
+++ b/app/assets/stylesheets/common/base/topic.scss
@@ -48,6 +48,10 @@
&.topic-progress-expanded {
z-index: z("fullscreen");
}
+
+ > * {
+ margin-bottom: 0.5em;
+ }
}
.topic-navigation-popup {
@@ -85,6 +89,10 @@
grid-area: posts;
grid-row: 3;
width: auto;
+
+ > * {
+ height: 100%;
+ }
}
.timeline-container:not(.timeline-fullscreen) {
diff --git a/spec/system/topic_view/localized_content_spec.rb b/spec/system/topic_view/localized_content_spec.rb
index 1ea8f49031e..c6ce8fb82e1 100644
--- a/spec/system/topic_view/localized_content_spec.rb
+++ b/spec/system/topic_view/localized_content_spec.rb
@@ -58,7 +58,7 @@ RSpec.describe "Localized topic" do
topic_list.visit_topic_with_title("孫子兵法からの人生戦略")
expect(topic_page.has_topic_title?("孫子兵法からの人生戦略")).to eq(true)
- page.find(".timeline-controls button.btn-toggle-localized-content").click
+ page.find("button.btn-toggle-localized-content").click
expect(topic_page.has_topic_title?("Life strategies from The Art of War")).to eq(true)