Opened 7 weeks ago
Closed 7 weeks ago
#8251 closed enhancement (fixed)
Ranked by impact, last %d days. should use _n()
| Reported by: | iworks | Owned by: | yani.iliev |
|---|---|---|---|
| Priority: | low | Milestone: | |
| Component: | Make (Get Involved) / P2 | Keywords: | has-patch |
| Cc: |
Description (last modified by )
File: wordpress.org/public_html/wp-content/themes/pub/wporg-breathe-2024/page-pledges.php
translation:
__( 'Ranked by impact, last %d days.', 'wporg-5ftf' ),
Should use _n() instead __():
_n( 'Ranked by impact, last %d day.', 'Ranked by impact, last %d days.', $window_days 'wporg-5ftf' ),
Attachments (1)
Change History (4)
#1
@
7 weeks ago
- Component General → Make (Get Involved) / P2
- Description modified (diff)
- Owner set to
- Status new → assigned
This ticket was mentioned in PR #648 on WordPress/wordpress.org by @yani.iliev.
7 weeks ago
#2
## 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_ALLOWEDever adds 1 (or any locale renders different plural forms for these counts): the singular form is now available to translators.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Generally we also use
number_format_i18n()as well, which then requires%sbe used to account for,,.,(which are generally only present for >1k)