From 4c3c690171a44faf65a63b3ab9c9df6d61c10473 Mon Sep 17 00:00:00 2001 From: Alan Guo Xiang Tan Date: Tue, 9 Apr 2024 14:08:36 +0800 Subject: [PATCH] DEV: Move settings descriptions into translation file This commit moves the description for the theme's settings into `locales/en.yml`. This follows our theme's best practice listed in https://meta.discourse.org/t/add-localizable-strings-to-themes-and-theme-components/109867 --- locales/en.yml | 20 ++++++++++++++++++++ settings.yml | 9 --------- 2 files changed, 20 insertions(+), 9 deletions(-) create mode 100644 locales/en.yml diff --git a/locales/en.yml b/locales/en.yml new file mode 100644 index 0000000..6cfb526 --- /dev/null +++ b/locales/en.yml @@ -0,0 +1,20 @@ +en: + theme_metadata: + settings: + show_description: 'Show description from "About This Category" post' + show_mobile: 'Show banners on mobile' + show_subcategory: 'Show banners for subcategories' + hide_if_no_description: 'Hide banners if category description is not set' + show_category_logo: 'Show category logo' + exceptions: "Banner will not show for these category NAMES." + categories: | + Banner will only show for these categories. Format as name:target (e.g., staff:all). + Accepted targets: + + plugin_outlet: "Changes the position of the banner on the page." + show_category_icon: Show category icon from the Discourse Category Icons component + override_category_icon_color: When the category icons are used, enabling this will make the icon match the banner text color diff --git a/settings.yml b/settings.yml index 4531960..76919ab 100644 --- a/settings.yml +++ b/settings.yml @@ -1,22 +1,17 @@ show_description: default: true - description: 'Show description from "About This Category" post' show_mobile: default: true - description: "Show banners on mobile" show_subcategory: default: true - description: "Show banners for subcategories" hide_if_no_description: default: true - description: "Hide banners if category description is not set" show_category_logo: default: false - description: "Displays the category logo as set in the category's settings" align_text: default: center @@ -30,7 +25,6 @@ exceptions: default: "" type: list list_type: simple - description: "Banner will not show for these category NAMES." categories: default: "" @@ -52,13 +46,10 @@ plugin_outlet: - "above-site-header" - "above-main-container" - "header-list-container-bottom" - description: "Changes the position of the banner on the page." refresh: true show_category_icon: default: false - description: Show category icon from the Discourse Category Icons component override_category_icon_color: default: false - description: When the category icons are used, enabling this will make the icon match the banner text color