Skip to content

Commit

Permalink
DEV: Move settings descriptions into translation file
Browse files Browse the repository at this point in the history
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
  • Loading branch information
tgxworld committed Apr 9, 2024
1 parent d61629c commit bdb89e6
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 9 deletions.
22 changes: 22 additions & 0 deletions locales/en.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
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


9 changes: 0 additions & 9 deletions settings.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -30,7 +25,6 @@ exceptions:
default: ""
type: list
list_type: simple
description: "Banner will not show for these category NAMES."

categories:
default: ""
Expand All @@ -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 <a href="https://meta.discourse.org/t/category-icons/104683" target="_blank">Discourse Category Icons component</a>

override_category_icon_color:
default: false
description: When the category icons are used, enabling this will make the icon match the banner text color

0 comments on commit bdb89e6

Please sign in to comment.