Making WordPress.org


Ignore:
Timestamp:
02/21/2017 12:03:58 AM (5 years ago)
Author:
iandunn
Message:

WordCamp Payments: Internationalize strings

I also converted uses of non-escapted i18n functions -- e.g., __() -- to their escaped counterparts -- e.g., esc_html__().

Fixes 2229
Props thomas-vitale

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/includes/reimbursement-request.php

    r3868 r4967  
    3434function register_post_type() {
    3535    $labels = array(
    36         'name'               => _x( 'Reimbursement Requests', 'general reimbursement requests', 'wordcamporg' ),
    37         'singular_name'      => _x( 'Reimbursement Request',  'post type singular name',        'wordcamporg' ),
    38         'menu_name'          => _x( 'Reimbursement Requests', 'admin menu',                     'wordcamporg' ),
    39         'name_admin_bar'     => _x( 'Reimbursement Requests', 'add new on admin bar',           'wordcamporg' ),
    40         'add_new'            => _x( 'Add New',                'reimbursement request',          'wordcamporg' ),
    41 
    42         'add_new_item'       => __( 'Add New Reimbursement Request',             'wordcamporg' ),
    43         'new_item'           => __( 'New Reimbursement Request',                 'wordcamporg' ),
    44         'edit_item'          => __( 'Edit Reimbursement Request',                'wordcamporg' ),
    45         'view_item'          => __( 'View Reimbursement Request',                'wordcamporg' ),
    46         'all_items'          => __( 'Reimbursements',                            'wordcamporg' ),
    47         'search_items'       => __( 'Search Reimbursement Requests',             'wordcamporg' ),
    48         'not_found'          => __( 'No Reimbursement Requests found.',          'wordcamporg' ),
    49         'not_found_in_trash' => __( 'No Reimbursement Requests found in Trash.', 'wordcamporg' ),
     36        'name'               => esc_html_x( 'Reimbursement Requests', 'general reimbursement requests', 'wordcamporg' ),
     37        'singular_name'      => esc_html_x( 'Reimbursement Request',  'post type singular name',        'wordcamporg' ),
     38        'menu_name'          => esc_html_x( 'Reimbursement Requests', 'admin menu',                     'wordcamporg' ),
     39        'name_admin_bar'     => esc_html_x( 'Reimbursement Requests', 'add new on admin bar',           'wordcamporg' ),
     40        'add_new'            => esc_html_x( 'Add New',                'reimbursement request',          'wordcamporg' ),
     41
     42        'add_new_item'       => esc_html__( 'Add New Reimbursement Request',             'wordcamporg' ),
     43        'new_item'           => esc_html__( 'New Reimbursement Request',                 'wordcamporg' ),
     44        'edit_item'          => esc_html__( 'Edit Reimbursement Request',                'wordcamporg' ),
     45        'view_item'          => esc_html__( 'View Reimbursement Request',                'wordcamporg' ),
     46        'all_items'          => esc_html__( 'Reimbursements',                            'wordcamporg' ),
     47        'search_items'       => esc_html__( 'Search Reimbursement Requests',             'wordcamporg' ),
     48        'not_found'          => esc_html__( 'No Reimbursement Requests found.',          'wordcamporg' ),
     49        'not_found_in_trash' => esc_html__( 'No Reimbursement Requests found in Trash.', 'wordcamporg' ),
    5050    );
    5151
     
    8989        'wcbrr_submitted',
    9090        array(
    91             'label'              => _x( 'Submitted', 'post', 'wordcamporg' ),
     91            'label'              => esc_html_x( 'Submitted', 'post', 'wordcamporg' ),
    9292            'label_count'        => _nx_noop( 'Submitted <span class="count">(%s)</span>', 'Submitted <span class="count">(%s)</span>', 'wordcamporg' ),
    9393            'public'             => true,
     
    9999        'wcbrr_info_requested',
    100100        array(
    101             'label'              => _x( 'Information Requested', 'post', 'wordcamporg' ),
     101            'label'              => esc_html_x( 'Information Requested', 'post', 'wordcamporg' ),
    102102            'label_count'        => _nx_noop( 'Information Requested <span class="count">(%s)</span>', 'Information Requested <span class="count">(%s)</span>', 'wordcamporg' ),
    103103            'public'             => true,
     
    109109        'wcbrr_rejected',
    110110        array(
    111             'label'              => _x( 'Rejected', 'post', 'wordcamporg' ),
     111            'label'              => esc_html_x( 'Rejected', 'post', 'wordcamporg' ),
    112112            'label_count'        => _nx_noop( 'Rejected <span class="count">(%s)</span>', 'Rejected <span class="count">(%s)</span>', 'wordcamporg' ),
    113113            'public'             => true,
     
    119119        'wcbrr_in_process',
    120120        array(
    121             'label'              => _x( 'Payment in Process', 'post', 'wordcamporg' ),
     121            'label'              => esc_html_x( 'Payment in Process', 'post', 'wordcamporg' ),
    122122            'label_count'        => _nx_noop( 'Payment in Process <span class="count">(%s)</span>', 'Payment in Process <span class="count">(%s)</span>', 'wordcamporg' ),
    123123            'public'             => true,
     
    129129        'wcbrr_paid',
    130130        array(
    131             'label'              => _x( 'Paid', 'post', 'wordcamporg' ),
     131            'label'              => esc_html_x( 'Paid', 'post', 'wordcamporg' ),
    132132            'label_count'        => _nx_noop( 'Paid <span class="count">(%s)</span>', 'Paid <span class="count">(%s)</span>', 'wordcamporg' ),
    133133            'public'             => true,
     
    148148    add_meta_box(
    149149        'submitdiv',
    150         __( 'Status', 'wordcamporg' ),
     150        esc_html__( 'Status', 'wordcamporg' ),
    151151        __NAMESPACE__ . '\render_status_metabox',
    152152        POST_TYPE,
     
    157157    add_meta_box(
    158158        'wcbrr_notes',
    159         __( 'Notes', 'wordcamporg' ),
     159        esc_html__( 'Notes', 'wordcamporg' ),
    160160        __NAMESPACE__ . '\render_notes_metabox',
    161161        POST_TYPE,
     
    166166    add_meta_box(
    167167        'wcbrr_general_information',
    168         __( 'General Information', 'wordcamporg' ),
     168        esc_html__( 'General Information', 'wordcamporg' ),
    169169        __NAMESPACE__ . '\render_general_information_metabox',
    170170        POST_TYPE,
     
    175175    $introduction_message = sprintf(
    176176        '<p>%s</p> <p>%s</p>',
    177         __( 'This is where you can give us information on how we can reimburse you for approved expenses that you paid out-of-pocket.', 'wordcamporg' ),
    178         __( 'Each wire transfer and check costs us processing fees, so if you have multiple out-of-pocket expenses, please try to group them into one reimbursement request.', 'wordcamporg' )
     177        esc_html__( 'This is where you can give us information on how we can reimburse you for approved expenses that you paid out-of-pocket.', 'wordcamporg' ),
     178        esc_html__( 'Each wire transfer and check costs us processing fees, so if you have multiple out-of-pocket expenses, please try to group them into one reimbursement request.', 'wordcamporg' )
    179179    );
    180180
    181181    add_meta_box(
    182182        'wcbrr_payment_information',
    183         __( 'Payment Information', 'wordcamporg' ),
     183        esc_html__( 'Payment Information', 'wordcamporg' ),
    184184        array( $wcp_payment_request, 'render_payment_metabox' ),    // todo centralize this instead of using directly from another module
    185185        POST_TYPE,
     
    196196    add_meta_box(
    197197        'wcbrr_expenses',
    198         __( 'Expenses', 'wordcamporg' ),
     198        esc_html__( 'Expenses', 'wordcamporg' ),
    199199        __NAMESPACE__ . '\render_expenses_metabox',
    200200        POST_TYPE,
     
    205205    add_meta_box(
    206206        'wcp_log',
    207         __( 'Log', 'wordcamporg' ),
     207        esc_html__( 'Log', 'wordcamporg' ),
    208208        __NAMESPACE__ . '\render_log_metabox',
    209209        POST_TYPE,
     
    281281    $editable_statuses = array( 'auto-draft', 'draft', 'wcb-incomplete' );
    282282    $current_user_can_edit_request = false;
    283     $submit_text = _x( 'Update', 'payment request', 'wordcamporg' );
     283    $submit_text = esc_html_x( 'Update', 'payment request', 'wordcamporg' );
    284284    $submit_note = '';
    285285
     
    287287        $current_user_can_edit_request = true;
    288288    } elseif ( in_array( $post->post_status, $editable_statuses ) ) {
    289         $submit_text = __( 'Submit for Review', 'wordcamporg' );
    290         $submit_note = __( 'Once submitted for review, this request can not be edited.', 'wordcamporg' );
     289        $submit_text = esc_html__( 'Submit for Review', 'wordcamporg' );
     290        $submit_note = esc_html__( 'Once submitted for review, this request can not be edited.', 'wordcamporg' );
    291291        $current_user_can_edit_request = true;
    292292    }
     
    297297    $request_id         = get_current_blog_id() . '-' . $post->ID;
    298298    $requested_by       = \WordCamp_Budgets::get_requester_name( $post->post_author );
    299     $update_text        = current_user_can( 'manage_network' ) ? __( 'Update Request', 'wordcamporg' ) : __( 'Send Request', 'wordcamporg' );
     299    $update_text        = current_user_can( 'manage_network' ) ? esc_html__( 'Update Request', 'wordcamporg' ) : esc_html__( 'Send Request', 'wordcamporg' );
    300300
    301301    require_once( dirname( __DIR__ ) . '/views/reimbursement-request/metabox-status.php' );
     
    350350function get_reimbursement_reasons() {
    351351    return array(
    352         'last-minute-purchase'   => __( 'Last-minute purchase',                   'wordcamporg' ),
    353         'vendor-required-cash'   => __( 'Vendor required cash payment',           'wordcamporg' ),
    354         'payment-on-delivery'    => __( 'Vendor required payment at delivery',    'wordcamporg' ),
    355         'convenience'            => __( 'Organizer convenience',                  'wordcamporg' ),
    356         'central-missed-payment' => __( "Payment by Central didn't come through", 'wordcamporg' ),
    357         'other'                  => __( 'Other (describe in next field)',         'wordcamporg' ),
     352        'last-minute-purchase'   => esc_html__( 'Last-minute purchase',                   'wordcamporg' ),
     353        'vendor-required-cash'   => esc_html__( 'Vendor required cash payment',           'wordcamporg' ),
     354        'payment-on-delivery'    => esc_html__( 'Vendor required payment at delivery',    'wordcamporg' ),
     355        'convenience'            => esc_html__( 'Organizer convenience',                  'wordcamporg' ),
     356        'central-missed-payment' => esc_html__( "Payment by Central didn't come through", 'wordcamporg' ),
     357        'other'                  => esc_html__( 'Other (describe in next field)',         'wordcamporg' ),
    358358    );
    359359}
Note: See TracChangeset for help on using the changeset viewer.