wp/wp-admin/includes/class-language-pack-upgrader.php
changeset 16 a86126ab1dd4
parent 9 177826044cd9
child 18 be944660c56a
--- a/wp/wp-admin/includes/class-language-pack-upgrader.php	Tue Oct 22 16:11:46 2019 +0200
+++ b/wp/wp-admin/includes/class-language-pack-upgrader.php	Tue Dec 15 13:49:49 2020 +0100
@@ -111,9 +111,9 @@
 	 */
 	public function upgrade_strings() {
 		$this->strings['starting_upgrade'] = __( 'Some of your translations need updating. Sit tight for a few more seconds while we update them as well.' );
-		$this->strings['up_to_date']       = __( 'The translations are up to date.' );
+		$this->strings['up_to_date']       = __( 'Your translations are all up to date.' );
 		$this->strings['no_package']       = __( 'Update package not available.' );
-		/* translators: %s: package URL */
+		/* translators: %s: Package URL. */
 		$this->strings['downloading_package'] = sprintf( __( 'Downloading translation from %s&#8230;' ), '<span class="code">%s</span>' );
 		$this->strings['unpack_package']      = __( 'Unpacking the update&#8230;' );
 		$this->strings['process_failed']      = __( 'Translation update failed.' );
@@ -188,11 +188,11 @@
 			return true;
 		}
 
-		if ( 'upgrader_process_complete' == current_filter() ) {
+		if ( 'upgrader_process_complete' === current_filter() ) {
 			$this->skin->feedback( 'starting_upgrade' );
 		}
 
-		// Remove any existing upgrade filters from the plugin/theme upgraders #WP29425 & #WP29230
+		// Remove any existing upgrade filters from the plugin/theme upgraders #WP29425 & #WP29230.
 		remove_all_filters( 'upgrader_pre_install' );
 		remove_all_filters( 'upgrader_clear_destination' );
 		remove_all_filters( 'upgrader_post_install' );
@@ -202,7 +202,7 @@
 
 		$this->skin->header();
 
-		// Connect to the Filesystem first.
+		// Connect to the filesystem first.
 		$res = $this->fs_connect( array( WP_CONTENT_DIR, WP_LANG_DIR ) );
 		if ( ! $res ) {
 			$this->skin->footer();
@@ -232,9 +232,9 @@
 			$this->skin->language_update = $language_update;
 
 			$destination = WP_LANG_DIR;
-			if ( 'plugin' == $language_update->type ) {
+			if ( 'plugin' === $language_update->type ) {
 				$destination .= '/plugins';
-			} elseif ( 'theme' == $language_update->type ) {
+			} elseif ( 'theme' === $language_update->type ) {
 				$destination .= '/themes';
 			}
 
@@ -332,11 +332,12 @@
 		$files = $wp_filesystem->dirlist( $remote_source );
 
 		// Check to see if a .po and .mo exist in the folder.
-		$po = $mo = false;
+		$po = false;
+		$mo = false;
 		foreach ( (array) $files as $file => $filedata ) {
-			if ( '.po' == substr( $file, -3 ) ) {
+			if ( '.po' === substr( $file, -3 ) ) {
 				$po = true;
-			} elseif ( '.mo' == substr( $file, -3 ) ) {
+			} elseif ( '.mo' === substr( $file, -3 ) ) {
 				$mo = true;
 			}
 		}
@@ -368,7 +369,7 @@
 	public function get_name_for_update( $update ) {
 		switch ( $update->type ) {
 			case 'core':
-				return 'WordPress'; // Not translated
+				return 'WordPress'; // Not translated.
 
 			case 'theme':
 				$theme = wp_get_theme( $update->slug );