Make WordPress Core

Opened 8 years ago

Closed 8 years ago

#45162 closed defect (bug) (fixed)

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

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

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 8 years ago.
Try this patch.
45162.2.patch​ (968 bytes ) - added by mukesh27 8 years ago.
updated patch.
45162.3.patch​ (936 bytes ) - added by mukesh27 8 years ago.
updated patch.

Download all attachments as: .zip

Change History (15)

#1 @SergeyBiryukov
8 years ago

  • Milestone Awaiting Review → 5.0

#2 @mukesh27
8 years ago

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

#3 @tobifjellner
8 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
8 years ago

Try this patch.

#4 @mukesh27
8 years ago

  • Keywords has-patch added

#5 @tobifjellner
8 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 8 years ago by tobifjellner (previous) (diff)

#6 @tobifjellner
8 years ago

  • Keywords needs-refresh added; has-patch removed

@mukesh27
8 years ago

updated patch.

#7 @tobifjellner
8 years ago

  • Keywords has-patch added; needs-refresh removed

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


8 years ago

@mukesh27
8 years ago

updated patch.

#10 @pento
8 years ago

  • Owner set to pento
  • Resolution → fixed
  • Status new → 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
8 years ago

  • Keywords fixed-5.0 added
  • Resolution fixed
  • Status closed → reopened

Reopening for trunk.

#12 @pento
8 years ago

  • Resolution → fixed
  • Status reopened → 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.