Plugin Directory

Changeset 2362415


Ignore:
Timestamp:
08/16/2020 02:52:47 PM (6 years ago)
Author:
IT-RAYS
Message:

localizing the strings in the color picker

File:
1 edited

Legend:

Unmodified
Added
Removed
  • rays-grid/tags/1.2.1/includes/class-base.php

    r2361567 r2362415  
    269269        wp_enqueue_style(RSGD_PFX.'-admin-css', RSGD_URI . 'assets/admin/css/admin.css');
    270270        wp_enqueue_style( RSGD_PFX.'-main-font', '//fonts.googleapis.com/css?family=Roboto:100,100i,300,300i,400,400i,700,700i,900,900i', false );
    271        
     271
    272272        wp_enqueue_script('wp-color-picker');
    273         wp_enqueue_script('wst-alpha-color', RSGD_URI . 'assets/admin/js/alpha-color.js', ['wp-color-picker'], null, true);
     273        wp_register_script( 'wst-alpha-color', RSGD_URI . 'assets/admin/js/alpha-color.js', ['wp-color-picker'], null, true );
     274
     275        $color_picker_strings = array(
     276            'clear'            => __( 'Clear', 'textdomain' ),
     277            'clearAriaLabel'   => __( 'Clear color', 'textdomain' ),
     278            'defaultString'    => __( 'Default', 'textdomain' ),
     279            'defaultAriaLabel' => __( 'Select default color', 'textdomain' ),
     280            'pick'             => __( 'Select Color', 'textdomain' ),
     281            'defaultLabel'     => __( 'Color value', 'textdomain' ),
     282        );
     283        wp_localize_script( 'wst-alpha-color', 'wpColorPickerL10n', $color_picker_strings );
     284        wp_enqueue_script( 'wst-alpha-color' );
    274285
    275286        wp_enqueue_script(RSGD_PFX.'-assets-js', RSGD_URI . 'assets/admin/js/assets.js', array('jquery'), null, true);
Note: See TracChangeset for help on using the changeset viewer.