Make WordPress Core

Opened 7 years ago

Closed 6 years ago

Last modified 5 years ago

#42139 closed defect (bug) (fixed)

Incorrect use of plural in script-loader.php

Reported by: tobifjellner's profile tobifjellner Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 5.1 Priority: normal
Severity: normal Version: 4.9
Component: Media Keywords:
Focuses: Cc:

Description

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 6 years ago.
42139.2.diff (1.6 KB) - added by metodiew 6 years ago.

Download all attachments as: .zip

Change History (12)

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

#3 @SergeyBiryukov
7 years 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 [38150].

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.

Version 0, edited 7 years ago by SergeyBiryukov (next)

@metodiew
6 years ago

@metodiew
6 years ago

#4 @metodiew
6 years 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
6 years 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
6 years ago

In 43345:

I18N: Remove unused MediaElement.js strings.

Props metodiew.
See #42139. Fixes #37453.

#7 @SergeyBiryukov
6 years 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
6 years ago

  • Milestone changed from 5.0 to 5.1

#9 @pento
6 years ago

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

No other strings have come up, closing.

#10 @SergeyBiryukov
5 years ago

In 47094:

I18N: Synchronize MediaElement.js translation strings with the currently bundled version.

Some strings were previously removed in [43345] and accidentally reintroduced in [44163].

Props ramiy.
Fixes #49249. See #42139, #37453.

Note: See TracTickets for help on using tickets.