Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#55876 closed defect (bug) (fixed)

Use consistent context for the "Add New" string when referring to media

Reported by: sergeybiryukov's profile SergeyBiryukov Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 6.1 Priority: normal
Severity: normal Version:
Component: I18N Keywords: good-first-bug has-patch
Focuses: Cc:

Description

Background: #21391.

As of [21948], the built-in attachment post type is registered with this string as the add_new label:

_x( 'Add New', 'add new media' )

This is the only place in core where the add new media context is used. All the other instances of this string, including the admin menu, use the file context:

_x( 'Add New', 'file' )

As far as I can tell, there is no reason for the context of these strings to be different, and it seems like an oversight. For consistency, the former string should use the file context as well.

Attachments (1)

55876.diff (655 bytes) - added by benjgrolleau 3 years ago.

Download all attachments as: .zip

Change History (5)

#1 @tobifjellner
3 years ago

Since this fix will remove one string without adding any new, it can safely be back-ported to 6.0.1, too :)

@benjgrolleau
3 years ago

#2 follow-up: @benjgrolleau
3 years ago

  • Keywords has-patch added; needs-patch removed

Hi there,
I've just changed on line 78, 'add new media' to 'file' as expected.

#3 in reply to: ↑ 2 @SergeyBiryukov
3 years ago

Replying to benjgrolleau:

I've just changed on line 78, 'add new media' to 'file' as expected.

Thanks for the patch! Looks great :)

Replying to tobifjellner:

Since this fix will remove one string without adding any new, it can safely be back-ported to 6.0.1, too :)

Yes, you're right. However, as it's not a regression in 6.0 and we generally try to minimize the number of changed files in minor releases due to reliability concerns for background updates, I think this can stay in 6.1 for now. If 6.0.1 ends up having any other changes in wp-includes/post.php, then this can be included as well.

#4 @SergeyBiryukov
3 years ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 53453:

I18N: Use consistent context for the "Add New" string when referring to media.

This replaces the only instance of the add new media context with file, used in other instances of the string.

Follow-up to [9198], [10680], [21948].

Props benjgrolleau, tobifjellner, SergeyBiryukov.
Fixes #55876.

Note: See TracTickets for help on using tickets.