Make WordPress Core

Opened 12 years ago

Closed 3 months ago

#29299 closed defect (bug) (fixed)

Plural forms not available for some strings

Reported by: pavelevap Owned by: joedolson
Priority: normal Milestone: 7.1
Component: Options, Meta APIs Version:
Severity: normal Keywords: has-patch commit
Cc: Focuses: accessibility, administration, ui-copy

Description

There are several strings which do not allow specific plurals in Settings - Reading.

<?php _e( 'posts' ); ?>

<?php _e( 'items' ); ?>

It looks strange when somebody inserts for example number 4 and our plural form is translated only for number 5.

Best solution would be probably some kind of string "Number of posts on page" (without ending "posts" string). But I am not sure about it...

See: https://core.trac.wordpress.org/browser/trunk/src/wp-admin/options-reading.php#L126

Attachments (3)

29299.diff​ (1.4 KB ) - added by GaryJ 10 years ago.
29299.2.diff​ (6.8 KB ) - added by SergeyBiryukov 10 years ago.
20299.patch​ (3.4 KB ) - added by shailu25 4 months ago.
Updated Patch with Latest Trunk

Download all attachments as: .zip

Change History (31)

#1 @johnbillion
12 years ago

Does this also affect the various inline fields on the Discussion Settings screen?

#2 @pavelevap
12 years ago

johnbillion: Yes, good point, I did not notice that.

#3 @SergeyBiryukov
12 years ago

This is closely related to #13673 and #15576.

Per nacin's comment:

We wouldn't customize this based on the number the user has entered. It should be whatever the maximum plural form is, if I had to guess.

I agree that it looks weird though, perhaps we could reconsider this.

#4 @pavelevap
12 years ago

Yes, but this could be easier...

What about "Number of posts to show on page" and remove "posts" string entirely?

And "Number of recent posts to show in RSS" and remove "items" string entirely?

#5 @chriscct7
11 years ago

  • Component I18N → Text Changes
  • Focuses administration added
  • Keywords needs-patch added

#6 @GaryJ
10 years ago

  • Keywords has-patch added; needs-patch removed

Patch added which amends the strings.

#7 follow-up: @SergeyBiryukov
10 years ago

  • Milestone Awaiting Review → 4.7
  • Owner set to SergeyBiryukov
  • Status new → reviewing

Seems consistent with [31696], though I'd like to see if we can address comment:1 as well.

#8 in reply to: ↑ 7 @GaryJ
10 years ago

Replying to SergeyBiryukov:

Seems consistent with [31696], though I'd like to see if we can address comment:1 as well.

Most of the items in Discussions settings are grouped, and have multiple controls i.e. a checkbox and an input field or dropdown.

They are going to need more thought, and they are mutually exclusive to those in Reading settings. A post-commit discussion or a new ticket may be best IMHO.

This ticket was mentioned in ​Slack in #core by stevenkword. ​View the logs.


10 years ago

#10 @SergeyBiryukov
10 years ago

29299.2.diff​ is what I had in mind:

  • Doesn't change the strings, but makes them support proper plural forms.
  • Handles the strings on Discussion Settings screen as well.
  • Adds translator comments.

#11 @SergeyBiryukov
10 years ago

  • Keywords commit added

#12 @pavelevap
10 years ago

I would vote for changing strings, because adding plural forms (from latest patch) will not work immediatelly when somebody change values (before saving them).

#13 @johnbillion
10 years ago

  • Keywords commit removed

The singular and plural forms in 29299.2.diff​ aren't an improvement because the form won't always be correct when selecting different values.

This ticket was mentioned in ​Slack in #core by jeffpaul. ​View the logs.


10 years ago

This ticket was mentioned in ​Slack in #core by jeffpaul. ​View the logs.


10 years ago

#16 @johnbillion
10 years ago

  • Keywords 2nd-opinion added
  • Milestone 4.7 → Future Release

This ticket was mentioned in ​Slack in #accessibility by sergey. ​View the logs.


10 years ago

#18 @afercia
10 years ago

  • Keywords settings-api added

#19 @SergeyBiryukov
8 years ago

#46908 was marked as a duplicate.

#20 @garrett-eclipse
7 years ago

  • Component Text Changes → Options, Meta APIs
  • Focuses ui-copy added

#21 @joedolson
6 months ago

  • Milestone Future Release → 7.1
  • Owner changed from SergeyBiryukov to joedolson
  • Status reviewing → accepted

Three of these are still present, and worth addressing: the two unassociated strings in options-reading.php, and the string about comment spam.

@shailu25
4 months ago

Updated Patch with Latest Trunk

This ticket was mentioned in ​PR #12731 on ​WordPress/wordpress-develop by ​@wildworks.


3 months ago
#22

Trac ticket: https://core.trac.wordpress.org/ticket/29299

## Use of AI Tools

Used for: Initial code skeleton and test suggestions; final implementation and tests were reviewed and edited by me.

#23 @wildworks
3 months ago

Attachment 20299.patch​ added
Updated Patch with Latest Trunk

I submitted this as a PR to make it easier for review. ​https://github.com/WordPress/wordpress-develop/pull/12731

This ticket was mentioned in ​PR #12777 on ​WordPress/wordpress-develop by ​@joedolson.


3 months ago
#24

Eliminates problems with plural/singular and fixes labeling for screen readers.

Trac ticket: https://core.trac.wordpress.org/ticket/29299

## Use of AI Tools

#25 @joedolson
3 months ago

  • Focuses accessibility added

Adding the accessibility focus, as these labels also have additional problems with orphaned text and a sentence structure input, which are problems for screen readers.

Updated PR eliminates the plural/singular problem and fixes the accessibility issue.

#26 @joedolson
3 months ago

The PR is fundamentally similar to what @garyj provided in 29299.diff, but extends the fix to also cover the discussions string.

#27 @afercia
3 months ago

  • Keywords commit added; 2nd-opinion settings-api removed

#28 @joedolson
3 months ago

  • Resolution → fixed
  • Status accepted → closed

In 62961:

Accessibility: Fix labels in discussion and reading settings.

Items per page, items per feed, and comment link moderation settings used inappropriate structures. For posts per page and items per feed, the label was missing context, provided in an orphaned text string; for the comment link moderation settings, the label used a sentence structure that created mis-ordered labeling for screen reader users. The labels also use numeric interpolations that should require handling plural and singular translations separately.

Alter structure to use appropriate combinations of label and aria-describedy structures, making the labeling more consistent and accessible. Restructures text to remove the need for alternate translations based on number.

Developed in ​https://github.com/WordPress/wordpress-develop/pull/12777

Props pavelevap, garyj, sergeybiryukov, shailu25, wildworks, johnbillion, chriscct7, afercia, garrett-eclipse, joedolson.
Fixes #29299.

Note: See TracTickets for help on using tickets.