Ticket #7897: arabic-comma.diff

File arabic-comma.diff, 3.5 KB (added by AhmadSherif, 4 years ago)
  • wp-includes/script-loader.php

     
    8181                'enterURL' => __('Enter the URL'), 
    8282                'enterImageURL' => __('Enter the URL of the image'), 
    8383                'enterImageDescription' => __('Enter a description of the image'), 
    84                 'l10n_print_after' => 'try{convertEntities(quicktagsL10n);}catch(e){};' 
     84                'l10n_print_after' => 'try{convertEntities(quicktagsL10n);}catch(e){};', 
     85                'comma' => __(',') 
    8586        ) ); 
    8687 
    8788        $scripts->add( 'colorpicker', "/wp-includes/js/colorpicker$suffix.js", array('prototype'), '3517m' ); 
  • wp-admin/admin-ajax.php

     
    5656        else 
    5757                die('0'); 
    5858 
    59         if ( false !== strpos( $s, ',' ) ) { 
    60                 $s = explode( ',', $s ); 
     59        $comma = __(','); 
     60        if ( false !== strpos( $s, $comma ) ) { 
     61                $s = explode( $comma, $s ); 
    6162                $s = $s[count( $s ) - 1]; 
    6263        } 
    6364        $s = trim( $s ); 
  • wp-admin/js/post.dev.js

     
    1010} 
    1111 
    1212function new_tag_remove_tag() { 
    13         var id = jQuery( this ).attr( 'id' ), num = id.split('-check-num-')[1], taxbox = jQuery(this).parents('.tagsdiv'), current_tags = taxbox.find( '.the-tags' ).val().split(','), new_tags = []; 
     13        var c = quicktagsL10n.comma; 
     14        var id = jQuery( this ).attr( 'id' ), num = id.split('-check-num-')[1], taxbox = jQuery(this).parents('.tagsdiv'), current_tags = taxbox.find( '.the-tags' ).val().split(c), new_tags = []; 
    1415        delete current_tags[num]; 
    1516 
    1617        jQuery.each( current_tags, function(key, val) { 
     
    2021                } 
    2122        }); 
    2223 
    23         taxbox.find('.the-tags').val( new_tags.join(',').replace(/\s*,+\s*/, ',').replace(/,+/, ',').replace(/,+\s+,+/, ',').replace(/,+\s*$/, '').replace(/^\s*,+/, '') ); 
     24        taxbox.find('.the-tags').val(eval("new_tags.join(quicktagsL10n.comma).replace(/\s+,+\s*/g, ',').replace(/,+/g, ',').replace(/,+\s+,+/g, ',').replace(/,+\s*$/g, '').replace(/^\s*,+/g, '')".replace(/','/g, "'"+c+"'").replace(/,[^ ]/g, c))); 
    2425 
    2526        tag_update_quickclicks(taxbox); 
    2627        return false; 
     
    3031        if ( jQuery(taxbox).find('.the-tags').length == 0 ) 
    3132                return; 
    3233 
    33         var current_tags = jQuery(taxbox).find('.the-tags').val().split(','); 
     34        var current_tags = jQuery(taxbox).find('.the-tags').val().split(quicktagsL10n.comma); 
    3435        jQuery(taxbox).find('.tagchecklist').empty(); 
    3536        shown = false; 
    3637 
     
    5253function tag_flush_to_text(id, a) { 
    5354        a = a || false; 
    5455        var taxbox, text, tags, newtags; 
     56        var c = quicktagsL10n.comma; 
    5557 
    5658        taxbox = jQuery('#'+id); 
    5759        text = a ? jQuery(a).text() : taxbox.find('input.newtag').val(); 
     
    6163                return false; 
    6264 
    6365        tags = taxbox.find('.the-tags').val(); 
    64         newtags = tags ? tags + ',' + text : text; 
     66        newtags = tags ? tags + c + text : text; 
    6567 
    6668        // massage 
    67         newtags = newtags.replace(/\s+,+\s*/g, ',').replace(/,+/g, ',').replace(/,+\s+,+/g, ',').replace(/,+\s*$/g, '').replace(/^\s*,+/g, ''); 
    68         newtags = array_unique_noempty(newtags.split(',')).join(','); 
     69        newtags = eval("newtags.replace(/\s+,+\s*/g, ',').replace(/,+/g, ',').replace(/,+\s+,+/g, ',').replace(/,+\s*$/g, '').replace(/^\s*,+/g, '')".replace(/','/g, "'"+c+"'").replace(/,[^ ]/g, c)); 
     70        newtags = array_unique_noempty(newtags.split(c)).join(c); 
    6971        taxbox.find('.the-tags').val(newtags); 
    7072        tag_update_quickclicks(taxbox); 
    7173