Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#46908 closed defect (bug) (duplicate)

Allow correct plural handling in settings for comments

Reported by: tobifjellner's profile tobifjellner Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: I18N Keywords:
Focuses: Cc:

Description

Location: /wp-admin/includes/class-wp-debug-data.php around line 82

printf(
__( 'Automatically close comments on articles older than %s days' ),
'</label> <label for="close_comments_days_old"><input name="close_comments_days_old" type="number" min="0" step="1" id="close_comments_days_old" value="' . esc_attr( get_option( 'close_comments_days_old' ) ) . '" class="small-text" />'
);

The string "Automatically close comments on articles older than %s days" ought to be put in _n() to have the translated string correctly reflect the currently chosen number of days. (In Russian, for instance, 21, 22 and 25 days give you different forms of the word "days")

Attachments (1)

2019-04-13.png (10.7 KB) - added by tobifjellner 6 years ago.
Current user view of this code in page /wp-admin/options-discussion.php

Download all attachments as: .zip

Change History (4)

#1 @ocean90
6 years ago

  • Keywords good-first-bug removed
  • Version trunk deleted

I don't think _n() can be used here. %s is not simply a placeholder for a static number but an input field to set the number of days.

#2 @tobifjellner
6 years ago

With just _n(), the string would correctly reflect the current setting for when the page was opened. Updating the string on-the-fly I'd see as "overkill".

@tobifjellner
6 years ago

Current user view of this code in page /wp-admin/options-discussion.php

#3 @SergeyBiryukov
6 years ago

  • Keywords needs-patch removed
  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Thanks for the report! We're already tracking this issue in #29299.

Note: See TracTickets for help on using tickets.