WordPress.org

Make WordPress Core

Opened 2 months ago

Closed 8 weeks ago

Last modified 6 weeks ago

#54238 closed enhancement (fixed)

Heterogeneus items in the list all medias

Reported by: jdy68 Owned by: audrasjb
Milestone: 5.9 Priority: normal
Severity: normal Version:
Component: Media Keywords: has-screenshots has-patch
Focuses: Cc:

Description

Hey there,

In the list "All medias items" in the media library - table or grid view, not all items are in the plural form. See screenshots "all-medias-list-view-grid-media-library.png" and "all-medias-list-view-table-media-library.png".
It would be more homogeneous if all items were in the plural. Three items are concerned: Audio, Video and Unattached. This last item isn't concerned in english but for example in french the past participle agrees in gender and in number, so there should be a plural form as well.
This error could be fixed by create the list of medias items with plural form of terms in the source files.

The strings (in translate) concerned are these following:
Audio: https://translate.wordpress.org/projects/wp/dev/fr/default/?filters%5Bstatus%5D=either&filters%5Boriginal_id%5D=48640&filters%5Btranslation_id%5D=2055161
Video: https://translate.wordpress.org/projects/wp/dev/fr/default/?filters%5Bstatus%5D=either&filters%5Boriginal_id%5D=48643&filters%5Btranslation_id%5D=2055164
Unattached: https://translate.wordpress.org/projects/wp/dev/fr/default/?filters%5Bstatus%5D=either&filters%5Boriginal_id%5D=142353&filters%5Btranslation_id%5D=88637873

Attachments (4)

all-medias-list-view-grid-media-library.png (10.5 KB) - added by jdy68 2 months ago.
all-medias-list-view-table-media-library.png (7.0 KB) - added by jdy68 2 months ago.
54238.diff (2.5 KB) - added by audrasjb 2 months ago.
Media: Add a translation context to the Media library filter items
54238.1.diff (2.1 KB) - added by audrasjb 8 weeks ago.
Revert the Trash - noun change from the patch

Download all attachments as: .zip

Change History (21)

#1 @audrasjb
2 months ago

  • Owner set to audrasjb
  • Status changed from new to accepted

Good point, thanks for raising it @jdy68
Patch welcome :)

Last edited 2 months ago by audrasjb (previous) (diff)

This ticket was mentioned in PR #1738 on WordPress/wordpress-develop by jennydupuy.


2 months ago

  • Keywords has-patch added

#6 @audrasjb
2 months ago

Thanks, but it would be better to provide a single patch for all these file changes :)

@audrasjb
2 months ago

Media: Add a translation context to the Media library filter items

#7 @audrasjb
2 months ago

  • Milestone changed from Awaiting Review to 5.9

54238.diff gather the 3 above PR into a single patch.

Moving for 5.9 consideration.

#8 @SergeyBiryukov
2 months ago

Thanks for the patch!

This looks good at a glance. I think _x( 'Trash', 'noun' ) should probably stay as is though, and does not need the context change. Otherwise, it would be inconsistent with _x( 'Trash', 'verb' ) elsewhere in core.

Last edited 2 months ago by SergeyBiryukov (previous) (diff)

#9 follow-up: @audrasjb
2 months ago

@SergeyBiryukov Yeah I understand your point, but this specific occurrence (media itemS) is related to multiple items so it need to be pluralized in a number of languages. Maybe we should use _x( 'Trash', 'Media items, noun' ) ?

#10 in reply to: ↑ 9 @SergeyBiryukov
2 months ago

Replying to audrasjb:

this specific occurrence (media itemS) is related to multiple items so it need to be pluralized in a number of languages.

Thanks! Just so I understand better, would "Trash" (noun) be translated differently in some languages depending on the number of trashed items? Would love to see some examples :) The ticket description does not seem to mention it, only "Audio", "Video", and "Unattached".

#11 @audrasjb
2 months ago

Yes, for example in French with supprimé / supprimés but I guess we could find other examples in some other locales.

#12 follow-up: @audrasjb
2 months ago

Hmm but in this context, Trash is a noun (translated to Corbeille in French). So it just can't be pluralized in the languages I know. We don't need this change in French you're right.
But I don't know is it is the case in other locales.

Maybe we can start with the initially proposed changes and see later for Trash?

#13 in reply to: ↑ 12 @SergeyBiryukov
2 months ago

Replying to audrasjb:

Maybe we can start with the initially proposed changes and see later for Trash?

Sounds good :)

My concern here was that _x() would still only allow one form, not both. For using a different form depending on the number of items we'd have to use _n() or _nx(), but it's not clear that there's a need for that here.

#14 @audrasjb
8 weeks ago

  • Keywords needs-refresh added

Yes, makes sense to me 👍

@audrasjb
8 weeks ago

Revert the Trash - noun change from the patch

#15 @audrasjb
8 weeks ago

  • Keywords needs-refresh removed

In 54238.1.diff: Patch updated to take into account @SergeyBiryukov’s above comment

#16 @SergeyBiryukov
8 weeks ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 51903:

I18N: Add context for some Media Library filter strings:

  • Audio
  • Video
  • Unattached

This allows for more homogeneous translations in languages where keeping a plural form is important.

Follow-up to [6910], [7397], [8901], [9556], [11749], [13100], [12110], [15491], [15578], [22743], [29426], [29625], [34256], [45651], [46437].

Props jdy68, audrasjb, SergeyBiryukov.
Fixes #54238.

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


6 weeks ago

Note: See TracTickets for help on using tickets.