WordPress.org

Make WordPress Core

Ticket #10001: translate-curly-quotes.diff

File translate-curly-quotes.diff, 1.8 KB (added by nbachiyski, 9 years ago)
  • wp-includes/formatting.php

     
    3232        $curl = '';
    3333        $textarr = preg_split('/(<.*>|\[.*\])/Us', $text, -1, PREG_SPLIT_DELIM_CAPTURE);
    3434        $stop = count($textarr);
     35       
     36        /* translators: opening curly quote */
     37        $opening_quote = _x('&#8220;', 'opening curly quote');
     38        /* translators: closing curly quote */
     39        $closing_quote = _x('&#8221;', 'closing curly quote');
     40       
    3541        $no_texturize_tags = apply_filters('no_texturize_tags', array('pre', 'code', 'kbd', 'style', 'script', 'tt'));
    3642        $no_texturize_shortcodes = apply_filters('no_texturize_shortcodes', array('code'));
    3743        $no_texturize_tags_stack = array();
     
    4753        }
    4854
    4955        $static_characters = array_merge(array('---', ' -- ', '--', ' - ', 'xn&#8211;', '...', '``', '\'s', '\'\'', ' (tm)'), $cockney);
    50         $static_replacements = array_merge(array('&#8212;', ' &#8212; ', '&#8211;', ' &#8211; ', 'xn--', '&#8230;', '&#8220;', '&#8217;s', '&#8221;', ' &#8482;'), $cockneyreplace);
     56        $static_replacements = array_merge(array('&#8212;', ' &#8212; ', '&#8211;', ' &#8211; ', 'xn--', '&#8230;', $opening_quote, '&#8217;s', $closing_quote, ' &#8482;'), $cockneyreplace);
    5157
    5258        $dynamic_characters = array('/\'(\d\d(?:&#8217;|\')?s)/', '/(\s|\A|")\'/', '/(\d+)"/', '/(\d+)\'/', '/(\S)\'([^\'\s])/', '/(\s|\A)"(?!\s)/', '/"(\s|\S|\Z)/', '/\'([\s.]|\Z)/', '/(\d+)x(\d+)/');
    53         $dynamic_replacements = array('&#8217;$1','$1&#8216;', '$1&#8243;', '$1&#8242;', '$1&#8217;$2', '$1&#8220;$2', '&#8221;$1', '&#8217;$1', '$1&#215;$2');
     59        $dynamic_replacements = array('&#8217;$1','$1&#8216;', '$1&#8243;', '$1&#8242;', '$1&#8217;$2', '$1'.$opening_quote.'$2', $closing_quote.'$1', '&#8217;$1', '$1&#215;$2');
    5460
    5561        for ( $i = 0; $i < $stop; $i++ ) {
    5662                $curl = $textarr[$i];