Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 2 years ago

#54238 closed enhancement (fixed)

Heterogeneus items in the list all medias

Reported by: jdy68's profile jdy68 Owned by: audrasjb's profile 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 3 years ago.
all-medias-list-view-table-media-library.png (7.0 KB) - added by jdy68 3 years ago.
54238.diff (2.5 KB) - added by audrasjb 3 years ago.
Media: Add a translation context to the Media library filter items
54238.1.diff (2.1 KB) - added by audrasjb 3 years ago.
Revert the Trash - noun change from the patch

Download all attachments as: .zip

Change History (24)

#1 @audrasjb
3 years ago

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

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

Last edited 3 years ago by audrasjb (previous) (diff)

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


3 years ago
#2

  • Keywords has-patch added

#6 @audrasjb
3 years ago

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

@audrasjb
3 years ago

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

#7 @audrasjb
3 years 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
3 years 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 3 years ago by SergeyBiryukov (previous) (diff)

#9 follow-up: @audrasjb
3 years 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
3 years 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
3 years 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
3 years 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
3 years 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
3 years ago

  • Keywords needs-refresh added

Yes, makes sense to me 👍

@audrasjb
3 years ago

Revert the Trash - noun change from the patch

#15 @audrasjb
3 years ago

  • Keywords needs-refresh removed

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

#16 @SergeyBiryukov
3 years 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.


3 years ago

Note: See TracTickets for help on using tickets.