I18N: Add missing translator comment in WP_Upgrader::generic_strings().

This resolves a WPCS warning:
> A gettext call containing placeholders was found, but was not accompanied by a "translators:" comment on the line above to clarify the meaning of the placeholders.

Includes moving `wp-content` out of the translatable string in a similar message in `_wp_delete_all_temp_backups()`.

Follow-up to [55720], [56117].

Props jrf.
See #58831.

git-svn-id: https://develop.svn.wordpress.org/trunk@56276 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2023-07-21 13:31:17 +00:00
parent f4fa4dd1ba
commit cc2424579e
2 changed files with 6 additions and 1 deletions
@@ -189,6 +189,7 @@ class WP_Upgrader {
$this->strings['fs_unavailable'] = __( 'Could not access filesystem.' );
$this->strings['fs_error'] = __( 'Filesystem error.' );
$this->strings['fs_no_root_dir'] = __( 'Unable to locate WordPress root directory.' );
/* translators: %s: Directory name. */
$this->strings['fs_no_content_dir'] = sprintf( __( 'Unable to locate WordPress content directory (%s).' ), 'wp-content' );
$this->strings['fs_no_plugins_dir'] = __( 'Unable to locate WordPress plugin directory.' );
$this->strings['fs_no_themes_dir'] = __( 'Unable to locate WordPress theme directory.' );
+5 -1
View File
@@ -1119,7 +1119,11 @@ function _wp_delete_all_temp_backups() {
}
if ( ! $wp_filesystem->wp_content_dir() ) {
return new WP_Error( 'fs_no_content_dir', __( 'Unable to locate WordPress content directory (wp-content).' ) );
return new WP_Error(
'fs_no_content_dir',
/* translators: %s: Directory name. */
sprintf( __( 'Unable to locate WordPress content directory (%s).' ), 'wp-content' )
);
}
$temp_backup_dir = $wp_filesystem->wp_content_dir() . 'upgrade-temp-backup/';