mirror of
https://github.com/discourse/discourse.git
synced 2026-08-11 02:59:07 +08:00
Site setting descriptions frequently mention other settings, but the
YAML had no consistent convention. The same reference appeared in at
least four styles -- `foo` in backticks, 'foo' in single quotes,
'humanized name' in single quotes, or just `bare_snake_case` -- and none
of them rendered as a link the admin could click to jump to the
referenced setting.
Introduce a compact marker, `{{setting:foo}}`, and expand it in
`SiteSettings::LabelFormatter.description`. The marker resolves to a
linkified anchor pointing at
`/admin/site_settings/category/all_results?filter=foo`, with the
humanized setting name as the visible label. Wiring the expansion at the
description seam (rather than in the I18n freedom patch) keeps the
change surgical: no impact on `I18n.t` for unrelated translations, no
`html_safe` plumbing changes in the JSON error pipeline.
Migrate ~67 references in `config/locales/server.en.yml` to the new
marker, covering every flavour of inconsistency found by two sweeps
(snake_case identifiers and quoted humanized names). The sweep also
turned up a stale reference: `enable_linkedin_oidc_logins` described
`linkedin_client_id`/`linkedin_client_secret`, which were renamed to
`linkedin_oidc_client_id`/`linkedin_oidc_client_secret` years ago.
Teach `script/i18n_lint.rb` to whitelist the new marker -- previously
any `{{...}}` was flagged as an accidental Handlebars-style mistake.
Reset the `label a` margin inherited from `discourse.scss` inside
`.setting-value`, so the linkified anchors sit flush against surrounding
text in checkbox-label descriptions.
Ref - t/148687
**BEFORE**
<img width="1594" height="1279" alt="2026-05-27 @ 14 27 33"
src="https://github.com/user-attachments/assets/aeaf2ee3-ce8c-484c-805d-cec9298f068b"
/>
**AFTER**
<img width="1594" height="1279" alt="2026-05-27 @ 14 25 32"
src="https://github.com/user-attachments/assets/bbead088-6f80-4903-b320-31b87d821428"
/>
|
||
|---|---|---|
| .. | ||
| environments | ||
| initializers | ||
| locales | ||
| application.rb | ||
| boot.rb | ||
| cdn.yml.sample | ||
| database.yml | ||
| deploy.rb.sample | ||
| dev_defaults.yml | ||
| discourse.config.sample | ||
| discourse.pill.sample | ||
| discourse_defaults.conf | ||
| environment.rb | ||
| logrotate.conf | ||
| multisite.yml.production-sample | ||
| nginx.sample.conf | ||
| official_plugins.json | ||
| pitchfork.conf.rb | ||
| projections.json | ||
| routes.rb | ||
| sidekiq.yml | ||
| site_settings.yml | ||
| spring.rb | ||
| thin.yml.sample | ||
| unicorn_launcher | ||