Make WordPress Core

Ticket #36496: 36496.diff

File 36496.diff, 1.5 KB (added by andg, 10 years ago)

"Script" and "style" should probably be wrapped in a code tag themselves, and a comment in the string should remind translators not to translate them.

  • wp-includes/functions.wp-scripts.php

    diff --git a/wp-includes/functions.wp-scripts.php b/wp-includes/functions.wp-scripts.php
    index 197368c..5a3bb27 100644
    a b function wp_add_inline_script( $handle, $data, $position = 'after' ) { 
    107107        _wp_scripts_maybe_doing_it_wrong( __FUNCTION__ );
    108108
    109109        if ( false !== stripos( $data, '</script>' ) ) {
    110                 _doing_it_wrong( __FUNCTION__, __( 'Do not pass script tags to wp_add_inline_script().' ), '4.5.0' );
     110                _doing_it_wrong( __FUNCTION__, sprintf( _x( 'Do not pass <code>script</code> tags to %s.', 'Do not translate the word "script"' ), 'wp_add_inline_script()' ), '4.5.0' );
    111111                $data = trim( preg_replace( '#<script[^>]*>(.*)</script>#is', '$1', $data ) );
    112112        }
    113113
  • wp-includes/functions.wp-styles.php

    diff --git a/wp-includes/functions.wp-styles.php b/wp-includes/functions.wp-styles.php
    index 3c9d649..d2c2e21 100644
    a b function wp_add_inline_style( $handle, $data ) { 
    8484        _wp_scripts_maybe_doing_it_wrong( __FUNCTION__ );
    8585
    8686        if ( false !== stripos( $data, '</style>' ) ) {
    87                 _doing_it_wrong( __FUNCTION__, __( 'Do not pass style tags to wp_add_inline_style().' ), '3.7' );
     87                _doing_it_wrong( __FUNCTION__, sprintf( _x( 'Do not pass <code>style</code> tags to %s.', 'Do not translate the word "style"' ), 'wp_add_inline_style()' ), '3.7' );
    8888                $data = trim( preg_replace( '#<style[^>]*>(.*)</style>#is', '$1', $data ) );
    8989        }
    9090