From aac6445fd093484a048514226b8a34f8c6ef72d2 Mon Sep 17 00:00:00 2001 From: Alan Guo Xiang Tan Date: Wed, 13 Mar 2024 13:47:36 +0800 Subject: [PATCH] DEV: Move setting translation to locale files instead. 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. --- locales/en.yml | 5 +++++ settings.yml | 4 ---- 2 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 locales/en.yml diff --git a/locales/en.yml b/locales/en.yml new file mode 100644 index 0000000..44c20e2 --- /dev/null +++ b/locales/en.yml @@ -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
Link text: The text for the link
Link title: the text that shows when the link is hovered
URL: The path for the link (can be relative)
View: vdm = desktop and mobile, vdo = desktop only, vmo = mobile only
Target: blank = opens in a new tab, self = opens in the same tab
Hide on scroll: 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
Language: 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" diff --git a/settings.yml b/settings.yml index 3c7f568..08f0128 100644 --- a/settings.yml +++ b/settings.yml @@ -2,8 +2,6 @@ custom_header_links: type: list 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" - description: - en: "Comma delimited in this order: link text, link title, URL, view, target, hide on scroll
Link text: The text for the link
Link title: the text that shows when the link is hovered
URL: The path for the link (can be relative)
View: vdm = desktop and mobile, vdo = desktop only, vmo = mobile only
Target: blank = opens in a new tab, self = opens in the same tab
Hide on scroll: 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
Language: blank = no locale assoaciated to the link, else insert a locale code (en, fr, de, ...)" links_position: default: right @@ -11,5 +9,3 @@ links_position: choices: - right - 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"