Skip to:
Content

BuddyPress.org

Changeset 12027


Ignore:
Timestamp:
05/01/2018 01:58:25 AM (2 years ago)
Author:
boonebgorges
Message:

Nouveau: Improved wording for message star/unstar feedback messages.

The previous technique for using sprintf() to build the message was not
i18n-friendly.

See #7786.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-templates/bp-nouveau/includes/messages/ajax.php

    r12022 r12027  
    473473    $action = str_replace( 'messages_', '', $_POST['action'] );
    474474
     475    if ( 'star' === $action ) {
     476        $error_message = __( 'There was a problem starring your message(s). Please try again.', 'buddypress' );
     477    } else {
     478        $error_message = __( 'There was a problem unstarring your message(s). Please try agian.', 'buddypress' );
     479    }
     480
    475481    $response = array(
    476         'feedback' => '<div class="bp-feedback error"><span class="bp-icon" aria-hidden="true"></span><p>' . sprintf( __( 'There was a problem marking your message(s) as %s. Please try again.', 'buddypress' ), $action ) . '</p></div>',
     482        'feedback' => '<div class="bp-feedback error"><span class="bp-icon" aria-hidden="true"></span><p>' . esc_html( $error_message ) . '</p></div>',
    477483        'type'     => 'error',
    478484    );
     
    543549    }
    544550
     551    if ( 'star' === $action ) {
     552        $success_message = __( 'Message(s) successfully starred.', 'buddypress' );
     553    } else {
     554        $success_message = __( 'Message(s) successfully unstarred.', 'buddypress' );
     555    }
     556
    545557    wp_send_json_success( array(
    546         'feedback' => '<div class="bp-feedback info"><span class="bp-icon" aria-hidden="true"></span><p>' . sprintf( __( 'Message(s) mark as %s', 'buddypress' ), $action ) . '</p></div>',
     558        'feedback' => '<div class="bp-feedback info"><span class="bp-icon" aria-hidden="true"></span><p>' . esc_html( $success_message ) . '</p></div>',
    547559        'type'     => 'success',
    548560        'messages' => $messages,
Note: See TracChangeset for help on using the changeset viewer.