Allow translators to change the curly quotes in wptexturize(), props nbachiyski fixes #10001
git-svn-id: http://svn.automattic.com/wordpress/trunk@11504 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
a71b8736cd
commit
d99872af71
|
@ -32,6 +32,12 @@ function wptexturize($text) {
|
|||
$curl = '';
|
||||
$textarr = preg_split('/(<.*>|\[.*\])/Us', $text, -1, PREG_SPLIT_DELIM_CAPTURE);
|
||||
$stop = count($textarr);
|
||||
|
||||
/* translators: opening curly quote */
|
||||
$opening_quote = _x('“', 'opening curly quote');
|
||||
/* translators: closing curly quote */
|
||||
$closing_quote = _x('”', 'closing curly quote');
|
||||
|
||||
$no_texturize_tags = apply_filters('no_texturize_tags', array('pre', 'code', 'kbd', 'style', 'script', 'tt'));
|
||||
$no_texturize_shortcodes = apply_filters('no_texturize_shortcodes', array('code'));
|
||||
$no_texturize_tags_stack = array();
|
||||
|
@ -47,10 +53,10 @@ function wptexturize($text) {
|
|||
}
|
||||
|
||||
$static_characters = array_merge(array('---', ' -- ', '--', ' - ', 'xn–', '...', '``', '\'s', '\'\'', ' (tm)'), $cockney);
|
||||
$static_replacements = array_merge(array('—', ' — ', '–', ' – ', 'xn--', '…', '“', '’s', '”', ' ™'), $cockneyreplace);
|
||||
$static_replacements = array_merge(array('—', ' — ', '–', ' – ', 'xn--', '…', $opening_quote, '’s', $closing_quote, ' ™'), $cockneyreplace);
|
||||
|
||||
$dynamic_characters = array('/\'(\d\d(?:’|\')?s)/', '/(\s|\A|")\'/', '/(\d+)"/', '/(\d+)\'/', '/(\S)\'([^\'\s])/', '/(\s|\A)"(?!\s)/', '/"(\s|\S|\Z)/', '/\'([\s.]|\Z)/', '/(\d+)x(\d+)/');
|
||||
$dynamic_replacements = array('’$1','$1‘', '$1″', '$1′', '$1’$2', '$1“$2', '”$1', '’$1', '$1×$2');
|
||||
$dynamic_replacements = array('’$1','$1‘', '$1″', '$1′', '$1’$2', '$1' . $opening_quote . '$2', $closing_quote . '$1', '’$1', '$1×$2');
|
||||
|
||||
for ( $i = 0; $i < $stop; $i++ ) {
|
||||
$curl = $textarr[$i];
|
||||
|
|
Loading…
Reference in New Issue