Making WordPress.org

Opened 5 years ago

Closed 5 years ago

#4871 closed defect (bug) (reported-upstream)

Translate platform fails to import Translators' comments that don't start in first line of comments

Reported by: tobifjellner's profile tobifjellner Owned by:
Milestone: Priority: normal
Component: Translate Site & Plugins Keywords:
Cc:

Description

For many places in core, the string extraction procedure fails to extract the comments to translators, if the comment doesn't start in the first comment line.
Here's one example of a comment that now doesn't get imported to translate.wordpress.org:

https://build.trac.wordpress.org/browser/trunk/wp-includes/comment-template.php?marks=902-910#L902

                        /*
                         * translators: If comment number in your language requires declension,
                         * translate this to 'on'. Do not translate into your own language.
                         */
                        if ( 'on' === _x( 'off', 'Comment number declension: on or off' ) ) {
                                $text = preg_replace( '#<span class="screen-reader-text">.+?</span>#', '', $more );
                                $text = preg_replace( '/&.+?;/', '', $text ); // Kill entities
                                $text = trim( strip_tags( $text ), '% ' );

One way to correct this could be to change all these occurrences in the core code, but a cleaner solution would be to fix the string import functions.

Change History (1)

#1 @ocean90
5 years ago

  • Priority changed from high to normal
  • Resolution set to reported-upstream
  • Status changed from new to closed

This is already fixed upstream: https://github.com/wp-cli/i18n-command/issues/169

We're waiting for a new WP-CLI version which fixes some other regressions.

Note: See TracTickets for help on using tickets.