diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index d8afaf477a2..28367d46917 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -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). diff --git a/lib/seed_data/topics.rb b/lib/seed_data/topics.rb index 79491af3eec..af32c747e69 100644 --- a/lib/seed_data/topics.rb +++ b/lib/seed_data/topics.rb @@ -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), diff --git a/spec/lib/seed_data/topics_spec.rb b/spec/lib/seed_data/topics_spec.rb index a22297dc4c9..c56a4a7b145 100644 --- a/spec/lib/seed_data/topics_spec.rb +++ b/spec/lib/seed_data/topics_spec.rb @@ -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