Skip to:
Content

BuddyPress.org

Changeset 12828


Ignore:
Timestamp:
12/21/2020 09:19:59 AM (12 months ago)
Author:
slaffik
Message:

XProfile: make admin js text nodes translatable

Certain user-facing strings added in the XProfile admin area using JavaScript were not translatable. We moved them to PHP and injected in JS using wp_localize_scripts().

Fixes #7076 (trunk).

Location:
trunk/src/bp-xprofile
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-xprofile/admin/js/admin.js

    r12528 r12828  
    1616        label        = document.createElement( 'label' ),
    1717        isDefault    = document.createElement( 'input' ),
    18         txt1         = document.createTextNode( 'Default Value' ),
    19         toDeleteText = document.createTextNode( 'Delete' ),
     18        txt1         = document.createTextNode( XProfileAdmin.text.default_value ),
     19        toDeleteText = document.createTextNode( XProfileAdmin.text.delete ),
    2020        toDeleteWrap = document.createElement( 'div' ),
    2121        toDelete     = document.createElement( 'a' );
  • trunk/src/bp-xprofile/bp-xprofile-cssjs.php

    r12401 r12828  
    5353        $strings = array(
    5454            'do_settings_section_field_types' => array(),
    55             'do_autolink' => '',
     55            'do_autolink'                     => '',
     56            'text'                            => array(
     57                'default_value' => __( 'Default Value', 'buddypress' ),
     58                'delete'        => __( 'Delete', 'buddypress' ),
     59            ),
    5660        );
    5761
Note: See TracChangeset for help on using the changeset viewer.