Making WordPress.org

Changeset 10956


Ignore:
Timestamp:
05/06/2021 05:55:52 AM (3 years ago)
Author:
dd32
Message:

Translate: When removing spaced placeholders, only do it if it ends on a word boundary.

This fixes it attempting to correct 100% over to 100%over, while still allowing it to convert <a href='% 1 $ s'> to <a href='%1$s'>.

Follow up to r10683.
See #5563, #5154.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-fixer/wporg-gp-translation-fixer.php

    r10954 r10956  
    6969                        // Try replacing spaced translation type with no spaces `% 1 $ s` (Machine translated text)
    7070                        $translation = preg_replace_callback(
    71                             '!%\s?(\d+\s?\$(?:\d+)?)?\s?[bcdefgosux]!i',
     71                            '!%\s?(\d+\s?\$(?:\d+)?)?\s?[bcdefgosux]\b!i',
    7272                            function( $m ) {
    7373                                return str_replace( ' ', '', $m[0] );
Note: See TracChangeset for help on using the changeset viewer.