Making WordPress.org


Ignore:
Timestamp:
08/24/2021 05:01:18 AM (4 years ago)
Author:
dd32
Message:

Translate: Support %@ placeholder format for better translations / warnings for Swift code, as used by the WordPress iOS app.

See https://wordpress.slack.com/archives/C02RP50LK/p1629720600345400

File:
1 edited

Legend:

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

    r11039 r11194  
    312312        // https://github.com/GlotPress/GlotPress-WP/pull/1237
    313313        add_filter( 'gp_warning_placeholders_re', function( $re ) {
    314             return '(?<!%)%(\d+\$(?:\d+)?)?[bcdefgosuxEFGX%l]';
     314            // bcdefgosuxEFGX are standard printf placeholders.
     315            // % is included to allow/expect %%.
     316            // l is included for wp_sprintf_l()'s custom %l format.
     317            // @ is included for Swift (as used for iOS mobile app) %@ string format.
     318            return '(?<!%)%(\d+\$(?:\d+)?)?[bcdefgosuxEFGX%l@]';
    315319        } );
    316320    }
Note: See TracChangeset for help on using the changeset viewer.