mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 05:03:39 +08:00
FIX: missing translation of guidelines_topic.body (#25505)
Broken in https://github.com/discourse/discourse/pull/25253
This commit is contained in:
parent
bfa3e056f1
commit
ba68ee4da7
|
@ -4506,7 +4506,7 @@ en:
|
|||
|
||||
## [Powered by You](#power)
|
||||
|
||||
This site is operated by your [friendly local staff](%{base_path}/about) and *you*, the community. If you have any further questions about how things should work here, open a new topic in %{feedback_category} and let’s discuss! If there’s a critical or urgent issue that can’t be handled by a meta topic or flag, contact us via the [staff page](%{base_path}/about).
|
||||
This site is operated by your [friendly local staff](%{base_path}/about) and *you*, the community. If you have any further questions about how things should work here, open a new topic in %{feedback_category_hashtag} and let’s discuss! If there’s a critical or urgent issue that can’t be handled by a meta topic or flag, contact us via the [staff page](%{base_path}/about).
|
||||
|
||||
<a name="tos"></a>
|
||||
|
||||
|
|
|
@ -53,6 +53,9 @@ module SeedData
|
|||
|
||||
def topics(site_setting_names: nil, include_welcome_topics: true, include_legal_topics: true)
|
||||
staff_category = Category.find_by(id: SiteSetting.staff_category_id)
|
||||
feedback_category = Category.find_by(id: SiteSetting.meta_category_id)
|
||||
feedback_category_hashtag =
|
||||
feedback_category ? "##{feedback_category.slug}" : "#site-feedback"
|
||||
|
||||
topics = []
|
||||
|
||||
|
@ -79,7 +82,12 @@ module SeedData
|
|||
topics << {
|
||||
site_setting_name: "guidelines_topic_id",
|
||||
title: I18n.t("guidelines_topic.title"),
|
||||
raw: I18n.t("guidelines_topic.body", base_path: Discourse.base_path),
|
||||
raw:
|
||||
I18n.t(
|
||||
"guidelines_topic.body",
|
||||
base_path: Discourse.base_path,
|
||||
feedback_category_hashtag: feedback_category_hashtag,
|
||||
),
|
||||
category: staff_category,
|
||||
static_first_reply: true,
|
||||
}
|
||||
|
@ -109,10 +117,6 @@ module SeedData
|
|||
""
|
||||
end
|
||||
|
||||
feedback_category = Category.find_by(id: SiteSetting.meta_category_id)
|
||||
feedback_category_hashtag =
|
||||
feedback_category ? "##{feedback_category.slug}" : "#site-feedback"
|
||||
|
||||
topics << {
|
||||
site_setting_name: "welcome_topic_id",
|
||||
title: I18n.t("discourse_welcome_topic.title", site_title: SiteSetting.title),
|
||||
|
|
|
@ -110,6 +110,18 @@ RSpec.describe SeedData::Topics do
|
|||
|
||||
expect(SiteSetting.tos_topic_id).to_not eq(-1)
|
||||
end
|
||||
|
||||
it "creates FAQ topic" do
|
||||
meta_category = Fabricate(:category, name: "Meta")
|
||||
staff_category = Fabricate(:category, name: "Feedback")
|
||||
SiteSetting.meta_category_id = meta_category.id
|
||||
SiteSetting.staff_category_id = staff_category.id
|
||||
create_topic("guidelines_topic_id")
|
||||
topic = Topic.find(SiteSetting.guidelines_topic_id)
|
||||
post = Post.find_by(topic_id: SiteSetting.guidelines_topic_id, post_number: 1)
|
||||
expect(topic.title).to_not include("Translation missing")
|
||||
expect(post.raw).to_not include("Translation missing")
|
||||
end
|
||||
end
|
||||
|
||||
describe "#update" do
|
||||
|
|
Loading…
Reference in New Issue
Block a user