From e129e656d1d6632fc24739993de15f6946470648 Mon Sep 17 00:00:00 2001 From: Claas Augner Date: Mon, 26 Dec 2016 15:56:33 +0100 Subject: [PATCH] FIX: Move Welcome topic to I18n --- config/locales/server.en.yml | 18 ++++++++++++++++++ db/fixtures/999_topics.rb | 3 +-- docs/WELCOME-TO-DISCOURSE.md | 12 ------------ 3 files changed, 19 insertions(+), 14 deletions(-) delete mode 100644 docs/WELCOME-TO-DISCOURSE.md diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index ac3cc342ff0..9edb4d0e52d 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -381,6 +381,24 @@ en: assets_topic_body: "This is a permanent topic, visible only to staff, for storing images and files used in the site design. Don't delete it!\n\n\nHere's how:\n\n\n1. Reply to this topic.\n2. Upload all the images you wish to use for logos, favicons, and so forth here. (Use the upload toolbar icon in the post editor, or drag-and-drop or paste images.)\n3. Submit your reply to post it.\n4. Right click the images in your new post to get the path to the uploaded images, or click the edit icon to edit your post and retrieve the path to the images. Copy the image paths.\n5. Paste those image paths into [basic settings](/admin/site_settings/category/required).\n\n\nIf you need to enable different file type uploads, edit `authorized_extensions` in the [file settings](/admin/site_settings/category/files)." + discourse_welcome_topic: + title: "Welcome to Discourse" + body: | + + The first paragraph of this pinned topic will be visible as a welcome message to all new visitors on your homepage. It's important! + + **Edit this** into a brief description of your community: + + - Who is it for? + - What can they find here? + - Why should they come here? + - Where can they read more (links, resources, etc)? + + + + You may want to close this topic via the admin :wrench: (at the upper right and bottom), so that replies don't pile up on an announcement. + + lounge_welcome: title: "Welcome to the Lounge" body: | diff --git a/db/fixtures/999_topics.rb b/db/fixtures/999_topics.rb index e46419fd20e..44109223e53 100644 --- a/db/fixtures/999_topics.rb +++ b/db/fixtures/999_topics.rb @@ -42,8 +42,7 @@ if seed_welcome_topics PostCreator.create(Discourse.system_user, raw: I18n.t('assets_topic_body'), title: "Assets for the site design", skip_validations: true, category: staff ? staff.name : nil) - welcome = File.read(Rails.root + 'docs/WELCOME-TO-DISCOURSE.md') - post = PostCreator.create(Discourse.system_user, raw: welcome, title: "Welcome to Discourse", skip_validations: true) + post = PostCreator.create(Discourse.system_user, raw: I18n.t('discourse_welcome_topic.body'), title: I18n.t('discourse_welcome_topic.title'), skip_validations: true) post.topic.update_pinned(true, true) lounge = Category.find_by(id: SiteSetting.lounge_category_id) diff --git a/docs/WELCOME-TO-DISCOURSE.md b/docs/WELCOME-TO-DISCOURSE.md deleted file mode 100644 index 42c2f12fb95..00000000000 --- a/docs/WELCOME-TO-DISCOURSE.md +++ /dev/null @@ -1,12 +0,0 @@ -The first paragraph of this pinned topic will be visible as a welcome message to all new visitors on your homepage. It's important! - -**Edit this** into a brief description of your community: - -- Who is it for? -- What can they find here? -- Why should they come here? -- Where can they read more (links, resources, etc)? - - - -You may want to close this topic via the admin :wrench: (at the upper right and bottom), so that replies don't pile up on an announcement.