diff --git a/app/assets/javascripts/discourse/app/controllers/about.js b/app/assets/javascripts/discourse/app/controllers/about.js
index f5a370bda68..19df4ab5eab 100644
--- a/app/assets/javascripts/discourse/app/controllers/about.js
+++ b/app/assets/javascripts/discourse/app/controllers/about.js
@@ -1,10 +1,13 @@
import Controller from "@ember/controller";
-import { gt } from "@ember/object/computed";
+import { alias, gt } from "@ember/object/computed";
import discourseComputed from "discourse-common/utils/decorators";
import I18n from "discourse-i18n";
export default Controller.extend({
faqOverridden: gt("siteSettings.faq_url.length", 0),
+ renameFaqToGuidelines: alias(
+ "siteSettings.experimental_rename_faq_to_guidelines"
+ ),
@discourseComputed("model.contact_url", "model.contact_email")
contactInfo(url, email) {
diff --git a/app/assets/javascripts/discourse/app/lib/sidebar/common/community-section/faq-section-link.js b/app/assets/javascripts/discourse/app/lib/sidebar/common/community-section/faq-section-link.js
index e95b44a7a4e..1f9bb6d3cd2 100644
--- a/app/assets/javascripts/discourse/app/lib/sidebar/common/community-section/faq-section-link.js
+++ b/app/assets/javascripts/discourse/app/lib/sidebar/common/community-section/faq-section-link.js
@@ -2,12 +2,18 @@ import BaseSectionLink from "discourse/lib/sidebar/base-community-section-link";
import I18n from "discourse-i18n";
export default class FAQSectionLink extends BaseSectionLink {
+ get renameToGuidelines() {
+ return (
+ this.siteSettings.experimental_rename_faq_to_guidelines && !this.href
+ );
+ }
+
get name() {
- return "faq";
+ return this.renameToGuidelines ? "guidelines" : "faq";
}
get route() {
- return "faq";
+ return this.renameToGuidelines ? "guidelines" : "faq";
}
get href() {
@@ -15,13 +21,19 @@ export default class FAQSectionLink extends BaseSectionLink {
}
get title() {
- return I18n.t("sidebar.sections.community.links.faq.title");
+ if (this.renameToGuidelines) {
+ return I18n.t("sidebar.sections.community.links.guidelines.title");
+ } else {
+ return I18n.t("sidebar.sections.community.links.faq.title");
+ }
}
get text() {
+ const name = this.renameToGuidelines ? "Guidelines" : this.overridenName;
+
return I18n.t(
- `sidebar.sections.community.links.${this.overridenName.toLowerCase()}.content`,
- { defaultValue: this.overridenName }
+ `sidebar.sections.community.links.${name.toLowerCase()}.content`,
+ { defaultValue: name }
);
}
diff --git a/app/assets/javascripts/discourse/app/templates/about.hbs b/app/assets/javascripts/discourse/app/templates/about.hbs
index f384cbd7b7c..e9524d335d4 100644
--- a/app/assets/javascripts/discourse/app/templates/about.hbs
+++ b/app/assets/javascripts/discourse/app/templates/about.hbs
@@ -15,6 +15,10 @@
{{i18n
"faq"
}}
+ {{else if this.renameFaqToGuidelines}}
+ {{i18n
+ "guidelines"
+ }}
{{else}}
{{i18n
"faq"
diff --git a/app/controllers/static_controller.rb b/app/controllers/static_controller.rb
index cd9ba087b08..1f633e45c0b 100644
--- a/app/controllers/static_controller.rb
+++ b/app/controllers/static_controller.rb
@@ -67,6 +67,7 @@ class StaticController < ApplicationController
@title = "#{title_prefix} - #{SiteSetting.title}"
@body = @topic.posts.first.cooked
@faq_overridden = !SiteSetting.faq_url.blank?
+ @experimental_rename_faq_to_guidelines = SiteSetting.experimental_rename_faq_to_guidelines
render :show, layout: !request.xhr?, formats: [:html]
return
diff --git a/app/views/layouts/_noscript_footer.html.erb b/app/views/layouts/_noscript_footer.html.erb
index 1d1f706b641..c6d4efbe0f1 100644
--- a/app/views/layouts/_noscript_footer.html.erb
+++ b/app/views/layouts/_noscript_footer.html.erb
@@ -13,7 +13,7 @@
- <%= t 'guidelines_topic.title' %>
+ <%= t 'guidelines_topic.guidelines_title' %>
<% if tos_url.present? %>
diff --git a/app/views/static/show.html.erb b/app/views/static/show.html.erb
index be8c9cd830f..9ed0c27a348 100644
--- a/app/views/static/show.html.erb
+++ b/app/views/static/show.html.erb
@@ -6,6 +6,8 @@
<% if @faq_overridden %>
' href='<%= guidelines_path %>'><%= t 'js.guidelines' %>
<%= t 'js.faq' %>
+ <% elsif @experimental_rename_faq_to_guidelines %>
+ ' href='<%=guidelines_path%>'><%= t 'js.guidelines' %>
<% else %>
' href='<%=faq_path%>'><%= t 'js.faq' %>
<% end %>
diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml
index f9d8bbb8fde..4d79a13e8d8 100644
--- a/config/locales/client.en.yml
+++ b/config/locales/client.en.yml
@@ -4772,6 +4772,9 @@ en:
faq:
content: "FAQ"
title: "Guidelines for using this site"
+ guidelines:
+ content: "Guidelines"
+ title: "Guidelines for using this site"
groups:
content: "Groups"
title: "List of available user groups"
diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml
index 7a17ca17631..b32205169e5 100644
--- a/config/locales/server.en.yml
+++ b/config/locales/server.en.yml
@@ -4624,6 +4624,7 @@ en:
guidelines_topic:
title: "FAQ/Guidelines"
+ guidelines_title: "Guidelines"
body: |
diff --git a/config/site_settings.yml b/config/site_settings.yml
index c540d295d78..c8789cefe75 100644
--- a/config/site_settings.yml
+++ b/config/site_settings.yml
@@ -2455,6 +2455,10 @@ legal:
default: ""
log_anonymizer_details:
default: true
+ experimental_rename_faq_to_guidelines:
+ default: false
+ hidden: true
+ client: true
backups:
enable_backups:
diff --git a/lib/seed_data/topics.rb b/lib/seed_data/topics.rb
index fbcf6b48350..dc30483928c 100644
--- a/lib/seed_data/topics.rb
+++ b/lib/seed_data/topics.rb
@@ -90,7 +90,14 @@ module SeedData
# FAQ/Guidelines
topics << {
site_setting_name: "guidelines_topic_id",
- title: I18n.t("guidelines_topic.title"),
+ title:
+ (
+ if SiteSetting.experimental_rename_faq_to_guidelines
+ I18n.t("guidelines_topic.guidelines_title")
+ else
+ I18n.t("guidelines_topic.title")
+ end
+ ),
raw:
I18n.t(
"guidelines_topic.body",