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"
/>
|
||
|---|---|---|
| .. | ||
| benchmarks | ||
| bulk_import | ||
| demon_test | ||
| import_scripts | ||
| .gitignore | ||
| alice.txt | ||
| analyse_message_bus.rb | ||
| analyze_sidekiq_queues.rb | ||
| assemble_ember_build.rb | ||
| backport.rb | ||
| bench.rb | ||
| biggest_objects.rb | ||
| boot_mem.rb | ||
| cache_critical_dns | ||
| check_forking.rb | ||
| check_reproducible_assets.rb | ||
| copyright-deposit | ||
| db_timestamps_mover.rb | ||
| diff_heaps.rb | ||
| discourse | ||
| docker_test.rb | ||
| i18n_lint.rb | ||
| install_minio_binaries.rb | ||
| list_bundled_plugins | ||
| local_minio_s3.rb | ||
| memory-analysis | ||
| memstats.rb | ||
| micro_bench.rb | ||
| mwrap_sidekiq | ||
| profile_db_generator.rb | ||
| promote_migrations | ||
| publish_built_assets.rb | ||
| rails | ||
| redis_memory.rb | ||
| require_profiler.rb | ||
| silence_successful_output | ||
| spawn_backup_restore.rb | ||
| start_test_db.rb | ||
| switch_container_ruby | ||
| test_email_settings.rb | ||
| test_mem.rb | ||
| test_memory_leak.rb | ||
| test_pretty_text.rb | ||
| thread_detective.rb | ||
| user_simulator.rb | ||