| @@ -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' ), |
| @@ -560,9 +552,9 @@ | ||
| 560 | 552 | $languages = $this->model->get_languages_list(); |
| 561 | 553 | |
| 562 | 554 | if ( $this->is_media_step_displayable( $languages ) ) { |
| 563 | 555 | $steps['media'] = array( |
| 564 | - 'name' => esc_html__( 'Media', 'polylang' ), | |
| 556 | + 'name' => __( 'Media', 'polylang' ), | |
| 565 | 557 | 'view' => array( $this, 'display_step_media' ), |
| 566 | 558 | 'handler' => array( $this, 'save_step_media' ), |
| 567 | 559 | 'scripts' => array(), |
| 568 | 560 | 'styles' => array(), |
| @@ -607,12 +599,11 @@ | ||
| 607 | 599 | */ |
| 608 | 600 | public function add_step_untranslated_contents( $steps ) { |
| 609 | 601 | if ( ! $this->model->get_languages_list() || $this->model->get_objects_with_no_lang( 1 ) ) { |
| 610 | 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 ); |
| 611 | - wp_localize_script( 'pll-wizard-language-choice', 'pll_dismiss_notice', esc_html__( 'Dismiss this notice.', 'polylang' ) ); | |
| 612 | 603 | wp_enqueue_style( 'pll-wizard-selectmenu', plugins_url( '/css/selectmenu' . $this->get_suffix() . '.css', POLYLANG_FILE ), array( 'dashicons', 'install', 'common' ), POLYLANG_VERSION ); |
| 613 | 604 | $steps['untranslated-contents'] = array( |
| 614 | - 'name' => esc_html__( 'Content', 'polylang' ), | |
| 605 | + 'name' => __( 'Content', 'polylang' ), | |
| 615 | 606 | 'view' => array( $this, 'display_step_untranslated_contents' ), |
| 616 | 607 | 'handler' => array( $this, 'save_step_untranslated_contents' ), |
| 617 | 608 | 'scripts' => array( 'pll-wizard-language-choice' ), |
| 618 | 609 | 'styles' => array( 'pll-wizard-selectmenu' ), |
| @@ -673,9 +664,9 @@ | ||
| 673 | 664 | $translations = $this->model->post->get_translations( $home_page_id ); |
| 674 | 665 | |
| 675 | 666 | if ( $home_page_id > 0 && ( ! $languages || count( $languages ) === 1 || count( $translations ) !== count( $languages ) ) ) { |
| 676 | 667 | $steps['home-page'] = array( |
| 677 | - 'name' => esc_html__( 'Homepage', 'polylang' ), | |
| 668 | + 'name' => __( 'Homepage', 'polylang' ), | |
| 678 | 669 | 'view' => array( $this, 'display_step_home_page' ), |
| 679 | 670 | 'handler' => array( $this, 'save_step_home_page' ), |
| 680 | 671 | 'scripts' => array(), |
| 681 | 672 | 'styles' => array(), |
| @@ -762,9 +753,9 @@ | ||
| 762 | 753 | * @since 2.7 |
| 763 | 754 | */ |
| 764 | 755 | public function add_step_last( $steps ) { |
| 765 | 756 | $steps['last'] = array( |
| 766 | - 'name' => esc_html__( 'Ready!', 'polylang' ), | |
| 757 | + 'name' => __( 'Ready!', 'polylang' ), | |
| 767 | 758 | 'view' => array( $this, 'display_step_last' ), |
| 768 | 759 | 'handler' => array( $this, 'save_step_last' ), |
| 769 | 760 | 'scripts' => array(), |
| 770 | 761 | 'styles' => array(), |