Skip to content

Commit

Permalink
Add script translations
Browse files Browse the repository at this point in the history
  • Loading branch information
renatho committed May 29, 2020
1 parent 897c821 commit ed1b01d
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion includes/admin/class-sensei-onboarding.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public function register_wizard_page() {
* @access private
*/
public function enqueue_scripts() {
Sensei()->assets->enqueue( 'sensei-setupwizard', 'onboarding/index.js', [], true );
Sensei()->assets->enqueue( 'sensei-setupwizard', 'onboarding/index.js', [ 'wp-i18n' ], true );
}

/**
Expand All @@ -144,6 +144,15 @@ public function enqueue_styles() {
Sensei()->assets->enqueue( 'sensei-setupwizard', 'onboarding/style.css', [ 'wp-components' ] );
}

/**
* Set script translations.
*
* @access private
*/
public function setup_wizard_set_script_translations() {
wp_set_script_translations( 'sensei-setupwizard', 'sensei-lms', Sensei()->plugin_path() . 'lang' );
}

/**
* Add global classes for Setup Wizard page.
*
Expand All @@ -164,6 +173,7 @@ public function prepare_wizard_page() {
add_action( 'admin_print_scripts', [ $this, 'enqueue_scripts' ] );
add_action( 'admin_print_styles', [ $this, 'enqueue_styles' ] );
add_action( 'admin_body_class', [ $this, 'filter_body_class' ] );
add_action( 'init', [ $this, 'setup_wizard_set_script_translations' ] );

add_filter( 'show_admin_bar', '__return_false' );
}
Expand Down

0 comments on commit ed1b01d

Please sign in to comment.