Remove <code> 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
This commit is contained in:
Sergey Biryukov 2015-11-06 00:40:09 +00:00
parent f0d1f15358
commit f75a2b113e

View File

@ -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 <code>style.css</code> 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.' ),
'<code>style.css</code>'
)
);
}
$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 <code>style.css</code> 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&#8217;t contain a valid theme header.' ),
'<code>style.css</code>'
)
);
}
// 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 <code>index.php</code> 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.' ),
'<code>index.php</code>'
)
);
}
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 <code>.po</code> or <code>.mo</code> files.' ) );
/* translators: 1: .po 2: .mo */
sprintf( __( 'The language pack is missing either the %1$s or %2$s files.' ),
'<code>.po</code>',
'<code>.mo</code>'
)
);
}
return $source;
}