0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-14 13:58:53 +08:00
discourse/plugins/discourse-topic-voting/config/locales/server.en.yml
Régis Hanol 8b03a42cd7
DEV: Linkify site setting references in descriptions (#40338)
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"
/>
2026-06-01 10:31:18 +02:00

69 lines
3.1 KiB
YAML
Executable file
Vendored

en:
category_types:
ideas:
name: "Ideas"
title: "ideas"
description: "Where members can submit ideas and vote on the ones they want most."
site_settings:
enable_ideas_category_type_setup: "Enables the Ideas category type option during category creation setup."
topic_voting_enabled: 'Allow users to vote on topics?'
topic_voting_enable_vote_limits: 'Limit the number of votes per user based on trust level'
topic_voting_tl0_vote_limit: 'How many active votes are TL0 users allowed?'
topic_voting_tl1_vote_limit: 'How many active votes are TL1 users allowed?'
topic_voting_tl2_vote_limit: 'How many active votes are TL2 users allowed?'
topic_voting_tl3_vote_limit: 'How many active votes are TL3 users allowed?'
topic_voting_tl4_vote_limit: 'How many active votes are TL4 users allowed?'
topic_voting_show_who_voted: 'Allow users to see who voted?'
topic_voting_show_votes_on_profile: 'Allow users to see their votes in their activity feed?'
topic_voting_alert_votes_left: 'Alert user when this many votes are left'
topic_voting:
category_type:
show_who_voted:
label: "Show who voted"
show_votes_on_profile:
label: "Show votes on profile"
enable_vote_limits:
label: "Limit member votes"
tl0_vote_limit:
label: "TL0 vote limit"
tl1_vote_limit:
label: "TL1 vote limit"
tl2_vote_limit:
label: "TL2 vote limit"
tl3_vote_limit:
label: "TL3 vote limit"
tl4_vote_limit:
label: "TL4 vote limit"
alert_votes_left:
label: "Alert when votes remaining"
votes_moved:
one: "A vote has been moved."
other: "%{count} votes have been moved."
duplicated_votes:
one: "A vote could not be moved because the user already voted in the other topic."
other: "%{count} votes could not be moved because their users already voted in the other topic."
filter:
description:
topic_votes_min: "Minimum number of topic votes"
topic_votes_max: "Maximum number of topic votes"
order_topic_votes: "Order topics by most votes"
order_topic_votes_asc: "Order topics by fewest votes"
badges:
daydreamer:
name: "Daydreamer"
description: "Receive a vote on your topic"
long_description: "This badge is granted for receiving a vote on one of your topics. :white_check_mark: Nice idea. :+1:"
brainstormer:
name: "Brainstormer"
description: "Receive 5 votes on your topic"
long_description: "This badge is granted for receiving 5 votes on one of your topics. :white_check_mark: Your topic is getting traction."
innovator:
name: "Innovator"
description: "Receive 15 votes on your topic"
long_description: "This badge is granted for receiving 15 votes on one of your topics. :white_check_mark: So good it can't be ignored."
visionary:
name: "Visionary"
description: "Receive 25 votes on your topic"
long_description: "This badge is granted for receiving 25 votes on one of your topics. :white_check_mark: Give the people what they want! :clap:"