From f75a2b113e06d71709146956c2b7539bfce55c2e Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 6 Nov 2015 00:40:09 +0000 Subject: [PATCH] Remove `` tags from translatable strings in `wp-admin/includes/class-wp-upgrader.php`. Add translator comments. Props ramiy. Fixes #34580. git-svn-id: https://develop.svn.wordpress.org/trunk@35551 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/class-wp-upgrader.php | 40 ++++++++++++++++----- 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/src/wp-admin/includes/class-wp-upgrader.php b/src/wp-admin/includes/class-wp-upgrader.php index 3cada43ed3..bcf6684ee9 100644 --- a/src/wp-admin/includes/class-wp-upgrader.php +++ b/src/wp-admin/includes/class-wp-upgrader.php @@ -1649,17 +1649,35 @@ class Theme_Upgrader extends WP_Upgrader { return $source; // A proper archive should have a style.css file in the single subdirectory - if ( ! file_exists( $working_directory . 'style.css' ) ) - return new WP_Error( 'incompatible_archive_theme_no_style', $this->strings['incompatible_archive'], __( 'The theme is missing the style.css stylesheet.' ) ); + if ( ! file_exists( $working_directory . 'style.css' ) ) { + return new WP_Error( 'incompatible_archive_theme_no_style', $this->strings['incompatible_archive'], + /* translators: %s: style.css */ + sprintf( __( 'The theme is missing the %s stylesheet.' ), + 'style.css' + ) + ); + } $info = get_file_data( $working_directory . 'style.css', array( 'Name' => 'Theme Name', 'Template' => 'Template' ) ); - if ( empty( $info['Name'] ) ) - return new WP_Error( 'incompatible_archive_theme_no_name', $this->strings['incompatible_archive'], __( "The style.css stylesheet doesn't contain a valid theme header." ) ); + if ( empty( $info['Name'] ) ) { + return new WP_Error( 'incompatible_archive_theme_no_name', $this->strings['incompatible_archive'], + /* translators: %s: style.css */ + sprintf( __( 'The %s stylesheet doesn’t contain a valid theme header.' ), + 'style.css' + ) + ); + } // If it's not a child theme, it must have at least an index.php to be legit. - if ( empty( $info['Template'] ) && ! file_exists( $working_directory . 'index.php' ) ) - return new WP_Error( 'incompatible_archive_theme_no_index', $this->strings['incompatible_archive'], __( 'The theme is missing the index.php file.' ) ); + if ( empty( $info['Template'] ) && ! file_exists( $working_directory . 'index.php' ) ) { + return new WP_Error( 'incompatible_archive_theme_no_index', $this->strings['incompatible_archive'], + /* translators: %s: index.php */ + sprintf( __( 'The theme is missing the %s file.' ), + 'index.php' + ) + ); + } return $source; } @@ -2084,9 +2102,15 @@ class Language_Pack_Upgrader extends WP_Upgrader { $mo = true; } - if ( ! $mo || ! $po ) + if ( ! $mo || ! $po ) { return new WP_Error( 'incompatible_archive_pomo', $this->strings['incompatible_archive'], - __( 'The language pack is missing either the .po or .mo files.' ) ); + /* translators: 1: .po 2: .mo */ + sprintf( __( 'The language pack is missing either the %1$s or %2$s files.' ), + '.po', + '.mo' + ) + ); + } return $source; }