PluginProbe
Polylang / 2.8
Polylang v2.8
3.8.9 3.8.8 3.8.7 3.8.6 3.8.5 3.8.4 3.8.3 2.7 2.7.0.1 2.7.1 2.7.2 2.7.3 2.7.4 2.8 2.8.1 2.8.2 2.8.3 2.8.4 2.9 2.9.1 2.9.2 3.0 3.0.1 3.0.2 3.0.3 All 233 releases
← All changes | modules/wizard/wizard.php +24 -34 2.9.22.8 View file →
@@ -25,15 +25,9 @@
25 25
26 26 /**
27 27 * List of steps
28 28 *
29 - * @var array $steps {
30 - * @type string $name i18n string which names the step.
31 - * @type callable $view The callback function use to display the step content.
32 - * @type callable $handler The callback function use to process the step after it is submitted.
33 - * @type array $scripts List of scripts handle needed by the step.
34 - * @type array $styles The list of styles handle needed by the step.
35 - * }
29 + * @var array $steps
36 30 */
37 31 protected $steps = array();
38 32
39 33 /**
@@ -121,9 +115,9 @@
121 115 * @return array Submenus list updated.
122 116 * @since 2.7
123 117 */
124 118 public function settings_tabs( $tabs ) {
125 - $tabs['wizard'] = esc_html__( 'Setup', 'polylang' );
119 + $tabs['wizard'] = __( 'Setup', 'polylang' );
126 120 return $tabs;
127 121 }
128 122
129 123 /**
@@ -338,12 +332,11 @@
338 332 // Add ajax action on deactivate button in licenses step.
339 333 add_action( 'wp_ajax_pll_deactivate_license', array( $this, 'deactivate_license' ) );
340 334
341 335 wp_enqueue_script( 'pll_admin', plugins_url( '/js/admin' . $this->get_suffix() . '.js', POLYLANG_FILE ), array( 'jquery', 'jquery-ui-selectmenu' ), POLYLANG_VERSION, true );
342 - wp_localize_script( 'pll_admin', 'pll_dismiss_notice', esc_html__( 'Dismiss this notice.', 'polylang' ) );
343 336 if ( $this->is_licenses_step_displayable() ) {
344 337 $steps['licenses'] = array(
345 - 'name' => esc_html__( 'Licenses', 'polylang' ),
338 + 'name' => __( 'Licenses', 'polylang' ),
346 339 'view' => array( $this, 'display_step_licenses' ),
347 340 'handler' => array( $this, 'save_step_licenses' ),
348 341 'scripts' => array( 'pll_admin' ), // Polylang admin script used by deactivate license button.
349 342 'styles' => array(),
@@ -428,35 +421,34 @@
428 421 * @since 2.7
429 422 */
430 423 public function add_step_languages( $steps ) {
431 424 wp_enqueue_script( 'pll-wizard-language-choice', plugins_url( '/js/admin' . $this->get_suffix() . '.js', POLYLANG_FILE ), array( 'jquery', 'jquery-ui-selectmenu' ), POLYLANG_VERSION, true );
432 - wp_localize_script( 'pll-wizard-language-choice', 'pll_dismiss_notice', esc_html__( 'Dismiss this notice.', 'polylang' ) );
433 425 wp_register_script( 'pll-wizard-languages', plugins_url( '/modules/wizard/js/languages-step' . $this->get_suffix() . '.js', POLYLANG_FILE ), array( 'jquery', 'jquery-ui-dialog' ), POLYLANG_VERSION, true );
434 426 wp_localize_script(
435 427 'pll-wizard-languages',
436 428 'pll_wizard_params',
437 429 array(
438 - 'i18n_no_language_selected' => esc_html__( 'You need to select a language to be added.', 'polylang' ),
439 - 'i18n_language_already_added' => esc_html__( 'You already added this language.', 'polylang' ),
440 - 'i18n_no_language_added' => esc_html__( 'You need to add at least one language.', 'polylang' ),
441 - 'i18n_add_language_needed' => esc_html__( 'You selected a language, however, to be able to continue, you need to add it.', 'polylang' ),
442 - 'i18n_pll_add_language' => esc_html__( 'Impossible to add the language.', 'polylang' ),
443 - 'i18n_pll_invalid_locale' => esc_html__( 'Enter a valid WordPress locale', 'polylang' ),
444 - 'i18n_pll_invalid_slug' => esc_html__( 'The language code contains invalid characters', 'polylang' ),
445 - 'i18n_pll_non_unique_slug' => esc_html__( 'The language code must be unique', 'polylang' ),
446 - 'i18n_pll_invalid_name' => esc_html__( 'The language must have a name', 'polylang' ),
447 - 'i18n_pll_invalid_flag' => esc_html__( 'The flag does not exist', 'polylang' ),
448 - 'i18n_dialog_title' => esc_html__( "A language wasn't added.", 'polylang' ),
449 - 'i18n_dialog_yes_button' => esc_html__( 'Yes', 'polylang' ),
450 - 'i18n_dialog_no_button' => esc_html__( 'No', 'polylang' ),
451 - 'i18n_dialog_ignore_button' => esc_html__( 'Ignore', 'polylang' ),
452 - 'i18n_remove_language_icon' => esc_html__( 'Remove this language', 'polylang' ),
430 + 'i18n_no_language_selected' => __( 'You need to select a language to be added.', 'polylang' ),
431 + 'i18n_language_already_added' => __( 'You already added this language.', 'polylang' ),
432 + 'i18n_no_language_added' => __( 'You need to add at least one language.', 'polylang' ),
433 + 'i18n_add_language_needed' => __( 'You selected a language, however, to be able to continue, you need to add it.', 'polylang' ),
434 + 'i18n_pll_add_language' => __( 'Impossible to add the language.', 'polylang' ),
435 + 'i18n_pll_invalid_locale' => __( 'Enter a valid WordPress locale', 'polylang' ),
436 + 'i18n_pll_invalid_slug' => __( 'The language code contains invalid characters', 'polylang' ),
437 + 'i18n_pll_non_unique_slug' => __( 'The language code must be unique', 'polylang' ),
438 + 'i18n_pll_invalid_name' => __( 'The language must have a name', 'polylang' ),
439 + 'i18n_pll_invalid_flag' => __( 'The flag does not exist', 'polylang' ),
440 + 'i18n_dialog_title' => __( "A language wasn't added.", 'polylang' ),
441 + 'i18n_dialog_yes_button' => __( 'Yes', 'polylang' ),
442 + 'i18n_dialog_no_button' => __( 'No', 'polylang' ),
443 + 'i18n_dialog_ignore_button' => __( 'Ignore', 'polylang' ),
444 + 'i18n_remove_language_icon' => __( 'Remove this language', 'polylang' ),
453 445 )
454 446 );
455 447 wp_enqueue_script( 'pll-wizard-languages' );
456 448 wp_enqueue_style( 'pll-wizard-selectmenu', plugins_url( '/css/selectmenu' . $this->get_suffix() . '.css', POLYLANG_FILE ), array( 'dashicons', 'install', 'common', 'wp-jquery-ui-dialog' ), POLYLANG_VERSION );
457 449 $steps['languages'] = array(
458 - 'name' => esc_html__( 'Languages', 'polylang' ),
450 + 'name' => __( 'Languages', 'polylang' ),
459 451 'view' => array( $this, 'display_step_languages' ),
460 452 'handler' => array( $this, 'save_step_languages' ),
461 453 'scripts' => array( 'pll-wizard-languages', 'pll-wizard-language-choice' ),
462 454 'styles' => array( 'pll-wizard-selectmenu' ),
@@ -538,10 +530,9 @@
538 530 )
539 531 );
540 532 exit;
541 533 }
542 -
543 - if ( 'en_US' !== $locale && current_user_can( 'install_languages' ) ) {
534 + if ( 'en_US' !== $locale ) {
544 535 wp_download_language_pack( $locale );
545 536 }
546 537 }
547 538 }
@@ -561,9 +552,9 @@
561 552 $languages = $this->model->get_languages_list();
562 553
563 554 if ( $this->is_media_step_displayable( $languages ) ) {
564 555 $steps['media'] = array(
565 - 'name' => esc_html__( 'Media', 'polylang' ),
556 + 'name' => __( 'Media', 'polylang' ),
566 557 'view' => array( $this, 'display_step_media' ),
567 558 'handler' => array( $this, 'save_step_media' ),
568 559 'scripts' => array(),
569 560 'styles' => array(),
@@ -608,12 +599,11 @@
608 599 */
609 600 public function add_step_untranslated_contents( $steps ) {
610 601 if ( ! $this->model->get_languages_list() || $this->model->get_objects_with_no_lang( 1 ) ) {
611 602 wp_enqueue_script( 'pll-wizard-language-choice', plugins_url( '/js/admin' . $this->get_suffix() . '.js', POLYLANG_FILE ), array( 'jquery', 'jquery-ui-selectmenu' ), POLYLANG_VERSION, true );
612 - wp_localize_script( 'pll-wizard-language-choice', 'pll_dismiss_notice', esc_html__( 'Dismiss this notice.', 'polylang' ) );
613 603 wp_enqueue_style( 'pll-wizard-selectmenu', plugins_url( '/css/selectmenu' . $this->get_suffix() . '.css', POLYLANG_FILE ), array( 'dashicons', 'install', 'common' ), POLYLANG_VERSION );
614 604 $steps['untranslated-contents'] = array(
615 - 'name' => esc_html__( 'Content', 'polylang' ),
605 + 'name' => __( 'Content', 'polylang' ),
616 606 'view' => array( $this, 'display_step_untranslated_contents' ),
617 607 'handler' => array( $this, 'save_step_untranslated_contents' ),
618 608 'scripts' => array( 'pll-wizard-language-choice' ),
619 609 'styles' => array( 'pll-wizard-selectmenu' ),
@@ -674,9 +664,9 @@
674 664 $translations = $this->model->post->get_translations( $home_page_id );
675 665
676 666 if ( $home_page_id > 0 && ( ! $languages || count( $languages ) === 1 || count( $translations ) !== count( $languages ) ) ) {
677 667 $steps['home-page'] = array(
678 - 'name' => esc_html__( 'Homepage', 'polylang' ),
668 + 'name' => __( 'Homepage', 'polylang' ),
679 669 'view' => array( $this, 'display_step_home_page' ),
680 670 'handler' => array( $this, 'save_step_home_page' ),
681 671 'scripts' => array(),
682 672 'styles' => array(),
@@ -763,9 +753,9 @@
763 753 * @since 2.7
764 754 */
765 755 public function add_step_last( $steps ) {
766 756 $steps['last'] = array(
767 - 'name' => esc_html__( 'Ready!', 'polylang' ),
757 + 'name' => __( 'Ready!', 'polylang' ),
768 758 'view' => array( $this, 'display_step_last' ),
769 759 'handler' => array( $this, 'save_step_last' ),
770 760 'scripts' => array(),
771 761 'styles' => array(),