wp/wp-admin/includes/class-language-pack-upgrader-skin.php
changeset 21 48c4eec2b7e6
parent 19 3d72ae0968f4
equal deleted inserted replaced
20:7b1b88e27a20 21:48c4eec2b7e6
    20 	public $done_header            = false;
    20 	public $done_header            = false;
    21 	public $done_footer            = false;
    21 	public $done_footer            = false;
    22 	public $display_footer_actions = true;
    22 	public $display_footer_actions = true;
    23 
    23 
    24 	/**
    24 	/**
       
    25 	 * Constructor.
       
    26 	 *
       
    27 	 * Sets up the language pack upgrader skin.
       
    28 	 *
       
    29 	 * @since 3.7.0
       
    30 	 *
    25 	 * @param array $args
    31 	 * @param array $args
    26 	 */
    32 	 */
    27 	public function __construct( $args = array() ) {
    33 	public function __construct( $args = array() ) {
    28 		$defaults = array(
    34 		$defaults = array(
    29 			'url'                => '',
    35 			'url'                => '',
    39 		}
    45 		}
    40 		parent::__construct( $args );
    46 		parent::__construct( $args );
    41 	}
    47 	}
    42 
    48 
    43 	/**
    49 	/**
       
    50 	 * Performs an action before a language pack update.
       
    51 	 *
       
    52 	 * @since 3.7.0
    44 	 */
    53 	 */
    45 	public function before() {
    54 	public function before() {
    46 		$name = $this->upgrader->get_name_for_update( $this->language_update );
    55 		$name = $this->upgrader->get_name_for_update( $this->language_update );
    47 
    56 
    48 		echo '<div class="update-messages lp-show-latest">';
    57 		echo '<div class="update-messages lp-show-latest">';
    50 		/* translators: 1: Project name (plugin, theme, or WordPress), 2: Language. */
    59 		/* translators: 1: Project name (plugin, theme, or WordPress), 2: Language. */
    51 		printf( '<h2>' . __( 'Updating translations for %1$s (%2$s)&#8230;' ) . '</h2>', $name, $this->language_update->language );
    60 		printf( '<h2>' . __( 'Updating translations for %1$s (%2$s)&#8230;' ) . '</h2>', $name, $this->language_update->language );
    52 	}
    61 	}
    53 
    62 
    54 	/**
    63 	/**
       
    64 	 * Displays an error message about the update.
       
    65 	 *
       
    66 	 * @since 3.7.0
    55 	 * @since 5.9.0 Renamed `$error` to `$errors` for PHP 8 named parameter support.
    67 	 * @since 5.9.0 Renamed `$error` to `$errors` for PHP 8 named parameter support.
    56 	 *
    68 	 *
    57 	 * @param string|WP_Error $errors Errors.
    69 	 * @param string|WP_Error $errors Errors.
    58 	 */
    70 	 */
    59 	public function error( $errors ) {
    71 	public function error( $errors ) {
    61 		parent::error( $errors );
    73 		parent::error( $errors );
    62 		echo '</div>';
    74 		echo '</div>';
    63 	}
    75 	}
    64 
    76 
    65 	/**
    77 	/**
       
    78 	 * Performs an action following a language pack update.
       
    79 	 *
       
    80 	 * @since 3.7.0
    66 	 */
    81 	 */
    67 	public function after() {
    82 	public function after() {
    68 		echo '</div>';
    83 		echo '</div>';
    69 	}
    84 	}
    70 
    85 
    71 	/**
    86 	/**
       
    87 	 * Displays the footer following the bulk update process.
       
    88 	 *
       
    89 	 * @since 3.7.0
    72 	 */
    90 	 */
    73 	public function bulk_footer() {
    91 	public function bulk_footer() {
    74 		$this->decrement_update_count( 'translation' );
    92 		$this->decrement_update_count( 'translation' );
    75 
    93 
    76 		$update_actions = array(
    94 		$update_actions = array(