Make WordPress Core

Opened 21 months ago

Closed 5 months ago

#42139 closed defect (bug) (fixed)

Incorrect use of plural in script-loader.php

Reported by: tobifjellner Owned by: SergeyBiryukov
Milestone: 5.1 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 13 months ago.
42139.2.diff (1.6 KB) - added by metodiew 13 months ago.

Download all attachments as: .zip

Change History (11)

#1 @swissspidy
21 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
21 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 21 months ago by rafa8626 (previous) (diff)

#3 @SergeyBiryukov
19 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 16 months ago by SergeyBiryukov (previous) (diff)

13 months ago

13 months ago

#4 @metodiew
13 months 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
13 months 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
13 months ago

In 43345:

I18N: Remove unused MediaElement.js strings.

Props metodiew.
See #42139. Fixes #37453.

#7 @SergeyBiryukov
13 months 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.

#8 @pento
8 months ago

  • Milestone changed from 5.0 to 5.1

#9 @pento
5 months ago

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

No other strings have come up, closing.

Note: See TracTickets for help on using tickets.