Ticket #10001: translate-curly-quotes.diff
File translate-curly-quotes.diff, 1.8 KB (added by , 16 years ago) |
---|
-
wp-includes/formatting.php
32 32 $curl = ''; 33 33 $textarr = preg_split('/(<.*>|\[.*\])/Us', $text, -1, PREG_SPLIT_DELIM_CAPTURE); 34 34 $stop = count($textarr); 35 36 /* translators: opening curly quote */ 37 $opening_quote = _x('“', 'opening curly quote'); 38 /* translators: closing curly quote */ 39 $closing_quote = _x('”', 'closing curly quote'); 40 35 41 $no_texturize_tags = apply_filters('no_texturize_tags', array('pre', 'code', 'kbd', 'style', 'script', 'tt')); 36 42 $no_texturize_shortcodes = apply_filters('no_texturize_shortcodes', array('code')); 37 43 $no_texturize_tags_stack = array(); … … 47 53 } 48 54 49 55 $static_characters = array_merge(array('---', ' -- ', '--', ' - ', 'xn–', '...', '``', '\'s', '\'\'', ' (tm)'), $cockney); 50 $static_replacements = array_merge(array('—', ' — ', '–', ' – ', 'xn--', '…', '“', '’s', '”', ' ™'), $cockneyreplace);56 $static_replacements = array_merge(array('—', ' — ', '–', ' – ', 'xn--', '…', $opening_quote, '’s', $closing_quote, ' ™'), $cockneyreplace); 51 57 52 58 $dynamic_characters = array('/\'(\d\d(?:’|\')?s)/', '/(\s|\A|")\'/', '/(\d+)"/', '/(\d+)\'/', '/(\S)\'([^\'\s])/', '/(\s|\A)"(?!\s)/', '/"(\s|\S|\Z)/', '/\'([\s.]|\Z)/', '/(\d+)x(\d+)/'); 53 $dynamic_replacements = array('’$1','$1‘', '$1″', '$1′', '$1’$2', '$1 “$2', '”$1', '’$1', '$1×$2');59 $dynamic_replacements = array('’$1','$1‘', '$1″', '$1′', '$1’$2', '$1'.$opening_quote.'$2', $closing_quote.'$1', '’$1', '$1×$2'); 54 60 55 61 for ( $i = 0; $i < $stop; $i++ ) { 56 62 $curl = $textarr[$i];