WordPress.org

Make WordPress Core

Changeset 11504


Ignore:
Timestamp:
06/02/09 00:27:53 (6 years ago)
Author:
azaozz
Message:

Allow translators to change the curly quotes in wptexturize(), props nbachiyski fixes #10001

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/formatting.php

    r11490 r11504  
    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')); 
     
    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++ ) { 
Note: See TracChangeset for help on using the changeset viewer.