Skip to content

[6.x] Fix pluralisation in form summary response count and toggle insight - #16143

Merged
jackmcdade merged 5 commits into
6.xfrom
fix-form-summary-plurals
Dec 4, 2026
Merged

jackmcdade merged 5 commits into
6.xfrom
fix-form-summary-plurals

Conversation

@duncanmcclean

@duncanmcclean duncanmcclean commented Dec 1, 2026 •

Copy link
Copy Markdown
Member

This pull request fixes two pluralisation issues in the form summary:

  • The response count read "1 responses" with a single response.
    • This was happening because Summary.vue used __() rather than __n().
    • I've fixed it by using __n() with singular and plural forms. It uses a :total placeholder rather than :count, since __n() always overwrites count with the raw number, which would drop the number formatting (eg. 1,234).
  • The toggle insight read "12 of users checked the toggle" when the metric was set to count.
    • This was happening because the same string was used for both metrics, and it never received the number, so it couldn't be pluralised.
    • I've fixed it by splitting it into form_summary_checked_insight_percent and form_summary_checked_insight_count, choosing the count string with __n(). The <Metric> component still renders the value before the string, like the field count in the form builder.

This PR also changes "users" to "respondents", since "users" usually means Control Panel users.

Before

1 response, count metric
1,234 responses, count metric

After

1 response, count metric
1,234 responses, count metric


Fixes #16140

Amp thread: https://ampcode.com/threads/T-3e928177-4945-4ff7-9204-2a36a24248e4

@jackmcdade
jackmcdade merged commit 2b64e50 into 6.x Dec 4, 2026
64 checks passed
@jackmcdade
jackmcdade deleted the fix-form-summary-plurals branch December 4, 2026 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Form summary: "1 responses" and "12 of users checked the toggle"

3 participants