Make WordPress Core

Opened 9 months ago

Last modified 10 days ago

#42139 assigned defect (bug)

Incorrect use of plural in script-loader.php

Reported by: tobifjellner Owned by: SergeyBiryukov
Milestone: 5.0 Priority: normal
Severity: normal Version: 4.9
Component: Media Keywords:
Focuses: Cc:


The version of script-loader.php currently in 4.9 beta contains seems to use __() where _n() is needed:

'mejs.time-jump-forward'   => array( __( 'Jump forward 1 second' ), __( 'Jump forward %1 seconds' ) ),
'mejs.time-skip-back'      => array( __( 'Skip back 1 second' ), __( 'Skip back %1 seconds' ) ),
'mejs.ad-skip-info'        => array( __( 'Skip in 1 second' ), __( 'Skip in %1 seconds' ) ),

Attachments (2)

42139.diff (1.6 KB) - added by metodiew 10 days ago.
42139.2.diff (1.6 KB) - added by metodiew 10 days ago.

Download all attachments as: .zip

Change History (9)

#1 @swissspidy
9 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

_n() can only be used when you know the amount you're dealing with at this point of time. However, these strings are used in JavaScript context and and the amount is not known.

It's not ideal, but until we have something like #20491 in core, we have to live with such exceptions.

#2 @rafa8626
9 months ago

@tobifjellner MEJS takes care of that translation already in terms of the plurals, so that's why there's no need for the use of the other method as @swissspidy mentioned

Last edited 9 months ago by rafa8626 (previous) (diff)

#3 @SergeyBiryukov
7 months ago

  • Milestone set to 5.0
  • Resolution invalid deleted
  • Status changed from closed to reopened

These strings had translator comments added in [38150] and accidentally removed in [41198].

That said, it looks like these strings are no longer used by MediaElement.js and could be removed from script-loader.php. When it's done, #37453 can be closed as well.

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

10 days ago

10 days ago

#4 @metodiew
10 days ago

Based on @SergeyBiryukov's comment, removing the strings would be enough. Given the fact of the amount of internet we have during the WCEU Contributor day, was able to upload only this file. Twice for some reason, I guess the WiFi reconnection.

Are they any other strings that need to be updated/removed or that would be enough? Thanks in advance!

#5 @tobifjellner
10 days ago

These were the strings I reacted to during translation of the new strings, back then. I haven't combed through the code, though.

#6 @SergeyBiryukov
10 days ago

In 43345:

I18N: Remove unused MediaElement.js strings.

Props metodiew.
See #42139. Fixes #37453.

#7 @SergeyBiryukov
10 days ago

  • Owner set to SergeyBiryukov
  • Status changed from reopened to assigned

Keeping the ticket open for now to see if there are any other old strings that should be removed.

Note: See TracTickets for help on using tickets.