WordPress.org

Make WordPress Core

Opened 2 years ago

Closed 23 months ago

#45162 closed defect (bug) (fixed)

Comments for translators must be added in script-loader.php

Reported by: tobifjellner Owned by: pento
Milestone: 5.0 Priority: normal
Severity: normal Version: 5.0
Component: Script Loader Keywords: has-patch, fixed-5.0
Focuses: Cc:

Description

Location: https://core.trac.wordpress.org/browser/branches/5.0/src/wp-includes/script-loader.php
Rows 410-414

<?php
'formats'  => array(
    'time'                => get_option( 'time_format', __( 'g:i a', 'default' ) ),
    'date'                => get_option( 'date_format', __( 'F j, Y', 'default' ) ),
    'datetime'            => __( 'F j, Y g:i a', 'default' ),
    'datetimeAbbreviated' => __( 'M j, Y g:i a', 'default' ),

It is very important to add translator comments for these strings with link to relevant documentation about time and date formats.

Attachments (3)

45162.patch (1000 bytes) - added by mukesh27 2 years ago.
Try this patch.
45162.2.patch (968 bytes) - added by mukesh27 2 years ago.
updated patch.
45162.3.patch (936 bytes) - added by mukesh27 2 years ago.
updated patch.

Download all attachments as: .zip

Change History (15)

#1 @SergeyBiryukov
2 years ago

  • Milestone changed from Awaiting Review to 5.0

#2 @mukesh27
2 years ago

@tobifjellner, You means needs to remove default text domain?

#3 @tobifjellner
2 years ago

No, you need to do something like:

<?php
'formats'  => array(
    /* translators: revision date format, see https://secure.php.net/date */
    'time'                => get_option( 'time_format', __( 'g:i a', 'default' ) ),
    /* translators: revision date format, see https://secure.php.net/date */
    'date'                => get_option( 'date_format', __( 'F j, Y', 'default' ) ),
    /* translators: revision date format, see https://secure.php.net/date */
    'datetime'            => __( 'F j, Y g:i a', 'default' ),
    /* translators: revision date format, see https://secure.php.net/date */
    'datetimeAbbreviated' => __( 'M j, Y g:i a', 'default' ),

@mukesh27
2 years ago

Try this patch.

#4 @mukesh27
2 years ago

  • Keywords has-patch added

#5 @tobifjellner
2 years ago

Hmm. My fault. The text "Revision date format" should be changed into:
"Time format", "Date format", "Date/time format" and "Abbreviated date/time format" respectively.
I was too concentrated on copying the URL correctly from a similar comment in different place that I forgot about the description.

Last edited 2 years ago by tobifjellner (previous) (diff)

#6 @tobifjellner
2 years ago

  • Keywords needs-refresh added; has-patch removed

@mukesh27
2 years ago

updated patch.

#7 @tobifjellner
2 years ago

  • Keywords has-patch added; needs-refresh removed

This ticket was mentioned in Slack in #core by mukeshpanchal27. View the logs.


2 years ago

@mukesh27
2 years ago

updated patch.

#10 @pento
2 years ago

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

In 43831:

Script Loader: Add translator comments and remove textdomains.

The inline script for wp-date incorrectly included a textdomain, and lacked translator comments.

Props mukesh27.
Fixes #45191, #45162.

#11 @SergeyBiryukov
2 years ago

  • Keywords fixed-5.0 added
  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopening for trunk.

#12 @pento
23 months ago

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

In 44171:

Script Loader: Add translator comments and remove textdomains.

The inline script for wp-date incorrectly included a textdomain, and lacked translator comments.

Merges [43831] from the 5.0 branch to trunk.

Props mukesh27.
Fixes #45191, #45162.

Note: See TracTickets for help on using tickets.