Skip to content

Five for the Future: Use _n() for the /pledges/ ranked-by-impact label#648

Closed
yani- wants to merge 1 commit into
WordPress:trunkfrom
yani-:meta/trac-8251
Closed

Five for the Future: Use _n() for the /pledges/ ranked-by-impact label#648
yani- wants to merge 1 commit into
WordPress:trunkfrom
yani-:meta/trac-8251

Conversation

@yani-

@yani- yani- commented May 24, 2026

Copy link
Copy Markdown

Summary

The Ranked by impact, last %d days. label on /pledges/ was wrapped in __(), which forces every translation to treat the day count as plural. Switch to _n() with a singular form (Ranked by impact, last %d day.) so locales that distinguish 1 vs N can render the singular when \$window_days is 1, and existing plural-aware locales keep the plural for 30/90/180.

Props iworks, dd32.

Fixes https://meta.trac.wordpress.org/ticket/8251.

Test plan

  • On /pledges/?window=30 (or 90 / 180): label reads "Ranked by impact, last 30 days." — unchanged.
  • If WINDOW_DAYS_ALLOWED ever adds 1 (or any locale renders different plural forms for these counts): the singular form is now available to translators.

…l so the day count is pluralized.

The "Ranked by impact, last %d days." label was wrapped in __() which forces every translation to handle the day count as plural. Switch to _n() with a singular form ("Ranked by impact, last %d day.") so locales that distinguish 1 vs N can render the singular when $window_days is 1, and so the existing plural-aware locales still get the plural form for 30/90/180.

Props iworks, dd32.
Fixes https://meta.trac.wordpress.org/ticket/8251.
Copilot AI review requested due to automatic review settings May 24, 2026 07:35
@github-actions

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props yaniiliev.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the /pledges/ “Ranked by impact…” label to use proper singular/plural translation handling, enabling locales to render “1 day” correctly when the window size is ever set to 1.

Changes:

  • Replaced __() with _n() for the “Ranked by impact, last %d days.” label to provide both singular and plural strings.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@bazza bazza closed this in de8444f May 24, 2026
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.

2 participants