DEV: Move settings descriptions into translation file (#48)

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
This commit is contained in:
Alan Guo Xiang Tan 2024-04-09 14:18:34 +08:00 committed by GitHub
parent d61629c0fc
commit 41ddbb8c11
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 20 additions and 9 deletions

20
locales/en.yml Normal file
View File

@ -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 <code>name:target</code> (e.g., <code>staff:all</code>).
Accepted targets:
<ul>
<li> all - named category and subcategories (default);
<li> no_sub - only the named category;
<li> only_sub - only subcategories of the named category.
</ul>
plugin_outlet: "Changes the position of the banner on the page."
show_category_icon: Show category icon from the <a href="https://meta.discourse.org/t/category-icons/104683" target="_blank">Discourse Category Icons component</a>
override_category_icon_color: When the category icons are used, enabling this will make the icon match the banner text color

View File

@ -1,22 +1,17 @@
show_description: show_description:
default: true default: true
description: 'Show description from "About This Category" post'
show_mobile: show_mobile:
default: true default: true
description: "Show banners on mobile"
show_subcategory: show_subcategory:
default: true default: true
description: "Show banners for subcategories"
hide_if_no_description: hide_if_no_description:
default: true default: true
description: "Hide banners if category description is not set"
show_category_logo: show_category_logo:
default: false default: false
description: "Displays the category logo as set in the category's settings"
align_text: align_text:
default: center default: center
@ -30,7 +25,6 @@ exceptions:
default: "" default: ""
type: list type: list
list_type: simple list_type: simple
description: "Banner will not show for these category NAMES."
categories: categories:
default: "" default: ""
@ -52,13 +46,10 @@ plugin_outlet:
- "above-site-header" - "above-site-header"
- "above-main-container" - "above-main-container"
- "header-list-container-bottom" - "header-list-container-bottom"
description: "Changes the position of the banner on the page."
refresh: true refresh: true
show_category_icon: show_category_icon:
default: false default: false
description: Show category icon from the <a href="https://meta.discourse.org/t/category-icons/104683" target="_blank">Discourse Category Icons component</a>
override_category_icon_color: override_category_icon_color:
default: false default: false
description: When the category icons are used, enabling this will make the icon match the banner text color