Opened 4 years ago

Closed 4 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:


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

                         * 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
4 years ago

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

This is already fixed upstream:

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

Note: See TracTickets for help on using tickets.