DEV: Move setting translation to locale files instead. (#49)

Why this change?

This is the recommended way to add descriptions for a theme setting as
mixing translation for multiple locales in the settings file is not
recommended per
https://meta.discourse.org/t/add-localizable-strings-to-themes-and-theme-components/109867.
This commit is contained in:
Alan Guo Xiang Tan 2024-03-13 14:04:03 +08:00 committed by GitHub
parent 191d16cea2
commit 601526cf77
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 4 deletions

5
locales/en.yml Normal file
View File

@ -0,0 +1,5 @@
en:
theme_metadata:
settings:
custom_header_links: "Comma delimited in this order: link text, link title, URL, view, target, hide on scroll<br><b>Link text:</b> The text for the link<br><b>Link title:</b> the text that shows when the link is hovered<br><b>URL:</b> The path for the link (can be relative)<br><b>View:</b> vdm = desktop and mobile, vdo = desktop only, vmo = mobile only<br><b>Target:</b> blank = opens in a new tab, self = opens in the same tab<br><b>Hide on scroll:</b> remove = hides the link when the title is expanded on topic pages keep = keeps the link visible even when the title is visible on topic pages<br><b>Language:</b> blank = no locale assoaciated to the link, else insert a locale code (en, fr, de, ...)"
links_position: "Note that when links are displayed on the left, they're automatically hidden while scrolling within topics to make room for the title"

View File

@ -2,8 +2,6 @@ custom_header_links:
type: list type: list
list_type: simple list_type: simple
default: "External link, this link will open in a new tab, https://meta.discourse.org, vdo, blank, remove|Most Liked, Posts with the most amount of likes, /latest/?order=op_likes, vdo, self, keep|Privacy, Our Privacy Policy, /privacy, vdm, self, keep" default: "External link, this link will open in a new tab, https://meta.discourse.org, vdo, blank, remove|Most Liked, Posts with the most amount of likes, /latest/?order=op_likes, vdo, self, keep|Privacy, Our Privacy Policy, /privacy, vdm, self, keep"
description:
en: "Comma delimited in this order: link text, link title, URL, view, target, hide on scroll<br><b>Link text:</b> The text for the link<br><b>Link title:</b> the text that shows when the link is hovered<br><b>URL:</b> The path for the link (can be relative)<br><b>View:</b> vdm = desktop and mobile, vdo = desktop only, vmo = mobile only<br><b>Target:</b> blank = opens in a new tab, self = opens in the same tab<br><b>Hide on scroll:</b> remove = hides the link when the title is expanded on topic pages keep = keeps the link visible even when the title is visible on topic pages<br><b>Language:</b> blank = no locale assoaciated to the link, else insert a locale code (en, fr, de, ...)"
links_position: links_position:
default: right default: right
@ -11,5 +9,3 @@ links_position:
choices: choices:
- right - right
- left - left
description:
en: "Note that when links are displayed on the left, they're automatically hidden while scrolling within topics to make room for the title"