UX: Fix label in search when tagging is disabled (#14503)

UX: Fix label in search when tagging is disabled (#14503)

diff --git a/app/assets/javascripts/discourse/app/controllers/full-page-search.js b/app/assets/javascripts/discourse/app/controllers/full-page-search.js
index 3ee95b5..d27a573 100644
--- a/app/assets/javascripts/discourse/app/controllers/full-page-search.js
+++ b/app/assets/javascripts/discourse/app/controllers/full-page-search.js
@@ -32,14 +32,6 @@ export const SEARCH_TYPE_DEFAULT = "topics_posts";
 export const SEARCH_TYPE_CATS_TAGS = "categories_tags";
 export const SEARCH_TYPE_USERS = "users";
 
-const SearchTypes = [
-  { name: I18n.t("search.type.default"), id: SEARCH_TYPE_DEFAULT },
-  {
-    name: I18n.t("search.type.categories_and_tags"),
-    id: SEARCH_TYPE_CATS_TAGS,
-  },
-  { name: I18n.t("search.type.users"), id: SEARCH_TYPE_USERS },
-];
 const PAGE_LIMIT = 10;
 
 export default Controller.extend({
@@ -66,11 +58,21 @@ export default Controller.extend({
   invalidSearch: false,
   page: 1,
   resultCount: null,
-  searchTypes: SearchTypes,
+  searchTypes: null,
 
   init() {
     this._super(...arguments);
 
+    this.set("searchTypes", [
+      { name: I18n.t("search.type.default"), id: SEARCH_TYPE_DEFAULT },
+      {
+        name: this.siteSettings.tagging_enabled
+          ? I18n.t("search.type.categories_and_tags")
+          : I18n.t("search.type.categories"),
+        id: SEARCH_TYPE_CATS_TAGS,
+      },
+      { name: I18n.t("search.type.users"), id: SEARCH_TYPE_USERS },
+    ]);
     this.selected = [];
   },
 
diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml
index df61770..d0e4046 100644
--- a/config/locales/client.en.yml
+++ b/config/locales/client.en.yml
@@ -2365,6 +2365,7 @@ en:
       type:
         default: "Topics/posts"
         users: "Users"
+        categories: "Categories"
         categories_and_tags: "Categories/tags"
 
       context:

GitHub sha: 23df78acb365f78e9cfae9a69385d05b09515642

This commit appears in #14503 which was approved by eviltrout. It was merged by pmusaraj.