Index: src/wp-admin/css/forms.css
===================================================================
--- src/wp-admin/css/forms.css	(revision 29579)
+++ src/wp-admin/css/forms.css	(working copy)
@@ -761,6 +761,13 @@
 	margin: -3px 3px;
 }
 
+.settings-php .language-chooser .spinner,
+.options-general-php .language-chooser .spinner {
+	float: none;
+	margin: 0 3px;
+	vertical-align: middle;
+}
+
 /* =Media Queries
 -------------------------------------------------------------- */
 
@@ -988,4 +995,3 @@
 		width: 49%;
 	}
 }
-
Index: src/wp-admin/includes/translation-install.php
===================================================================
--- src/wp-admin/includes/translation-install.php	(revision 0)
+++ src/wp-admin/includes/translation-install.php	(working copy)
@@ -0,0 +1,232 @@
+<?php
+/**
+ * WordPress Translation Install Administration API
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+
+/**
+ * Retrieve translations from WordPress Translation API.
+ *
+ * @since 4.0.0
+ *
+ * @param string       $type Type of translations. Accepts 'plugins', 'themes', 'core'.
+ * @param array|object $args Translation API arguments. Optional.
+ * @return object|WP_Error On success an object of translations, WP_Error on failure.
+ */
+function translations_api( $type, $args = null ) {
+	include( ABSPATH . WPINC . '/version.php' ); // include an unmodified $wp_version
+
+	if ( ! in_array( $type, array( 'plugins', 'themes', 'core' ) ) ) {
+		return	new WP_Error( 'invalid_type', __( 'Invalid translation type.' ) );
+	}
+
+	/**
+	 * Allows a plugin to override the WordPress.org Translation Install API entirely.
+	 *
+	 * @since 4.0.0
+	 *
+	 * @param bool|array  $result The result object. Default false.
+	 * @param string      $type   The type of translations being requested.
+	 * @param object      $args   Translation API arguments.
+	 */
+	$res = apply_filters( 'translations_api', false, $type, $args );
+
+	if ( false === $res ) {
+		$url = $http_url = 'http://api.wordpress.org/translations/' . $type . '/1.0/';
+		if ( $ssl = wp_http_supports( array( 'ssl' ) ) ) {
+			$url = set_url_scheme( $url, 'https' );
+		}
+
+		$options = array(
+			'timeout' => 3,
+			'body' => array(
+				'wp_version' => $wp_version,
+				'locale'     => get_locale(),
+				'version'    => $args['version'], // Version of plugin, theme or core
+			),
+		);
+
+		if ( 'core' !== $type ) {
+			$options['body']['slug'] = $args['slug']; // Plugin or theme slug
+		}
+
+		$request = wp_remote_post( $url, $options );
+
+		if ( $ssl && is_wp_error( $request ) ) {
+			trigger_error( __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href="https://wordpress.org/support/">support forums</a>.' ) . ' ' . __( '(WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.)' ), headers_sent() || WP_DEBUG ? E_USER_WARNING : E_USER_NOTICE );
+
+			$request = wp_remote_post( $http_url, $options );
+		}
+
+		if ( is_wp_error( $request ) ) {
+			$res = new WP_Error( 'translations_api_failed', __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href="https://wordpress.org/support/">support forums</a>.' ), $request->get_error_message() );
+		} else {
+			$res = json_decode( wp_remote_retrieve_body( $request ), true );
+			if ( ! is_object( $res ) && ! is_array( $res ) ) {
+				$res = new WP_Error( 'translations_api_failed', __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href="https://wordpress.org/support/">support forums</a>.' ), wp_remote_retrieve_body( $request ) );
+			}
+		}
+	}
+
+	/**
+	 * Filter the Translation Install API response results.
+	 *
+	 * @since 4.0.0
+	 *
+	 * @param object|WP_Error $res  Response object or WP_Error.
+	 * @param string          $type The type of translations being requested.
+	 * @param object          $args Translation API arguments.
+	 */
+	return apply_filters( 'translations_api_result', $res, $type, $args );
+}
+
+/**
+ * Get available translations from the WordPress.org API.
+ *
+ * @since 4.0.0
+ *
+ * @see translations_api()
+ *
+ * @return array Array of translations, each an array of data. If the API response results
+ *               in an error, an empty array will be returned.
+ */
+function wp_get_available_translations() {
+	if ( ! defined( 'WP_INSTALLING' ) && false !== ( $translations = get_site_transient( 'available_translations' ) ) ) {
+		return $translations;
+	}
+
+	include( ABSPATH . WPINC . '/version.php' ); // include an unmodified $wp_version
+
+	$api = translations_api( 'core', array( 'version' => $wp_version ) );
+
+	if ( is_wp_error( $api ) || empty( $api['translations'] ) ) {
+		return array();
+	}
+
+	$translations = array();
+	// Key the array with the language code for now
+	foreach ( $api['translations'] as $translation ) {
+		$translations[ $translation['language'] ] = $translation;
+	}
+
+	if ( ! defined( 'WP_INSTALLING' ) ) {
+		set_site_transient( 'available_translations', $translations, 3 * HOUR_IN_SECONDS );
+	}
+
+	return $translations;
+}
+
+/**
+ * Output the select form for the language selection on the installation screen.
+ *
+ * @since 4.0.0
+ *
+ * @param array $languages Array of available languages (populated via the Translation API).
+ */
+function wp_install_language_form( $languages ) {
+	$installed_languages = get_available_languages();
+
+	echo "<label class='screen-reader-text' for='language'>Select a default language</label>\n";
+	echo "<select size='14' name='language' id='language'>\n";
+	echo '<option value="" lang="en" selected="selected" data-continue="Continue" data-installed="1">English (United States)</option>';
+	echo "\n";
+
+	if ( defined( 'WPLANG' ) && ( '' !== WPLANG ) && ( 'en_US' !== WPLANG ) ) {
+		if ( isset( $languages[ WPLANG ] ) ) {
+			$language = $languages[ WPLANG ];
+			echo '<option value="' . esc_attr( $language['language'] ) . '" lang="' . esc_attr( $language['iso'][1] ) . '">' . esc_html( $language['native_name'] ) . "</option>\n";
+			unset( $languages[ WPLANG ] );
+		}
+	}
+
+	foreach ( $languages as $language ) {
+		printf( '<option value="%s" lang="%s" data-continue="%s"%s>%s</option>' . "\n",
+			esc_attr( $language['language'] ),
+			esc_attr( $language['iso'][1] ),
+			esc_attr( $language['strings']['continue'] ),
+			in_array( $language['language'], $installed_languages ) ? ' data-installed="1"' : '',
+			esc_html( $language['native_name'] ) );
+	}
+	echo "</select>\n";
+	echo '<p class="step"><span class="spinner"></span><input id="language-continue" type="submit" class="button button-primary button-large" value="Continue" /></p>';
+}
+
+/**
+ * Download a language pack.
+ *
+ * @since 4.0.0
+ *
+ * @see wp_get_available_translations()
+ *
+ * @param string $download Language code to download.
+ * @return string|bool Returns the language code if successfully downloaded
+ *                     (or already installed), or false on failure.
+ */
+function wp_install_download_language_pack( $download ) {
+	// Check if the translation is already installed.
+	if ( in_array( $download, get_available_languages() ) ) {
+		return $download;
+	}
+
+	if ( defined( 'DISALLOW_FILE_MODS' ) && DISALLOW_FILE_MODS ) {
+		return false;
+	}
+
+	// Confirm the translation is one we can download.
+	$translations = wp_get_available_translations();
+	if ( ! $translations ) {
+		return false;
+	}
+	foreach ( $translations as $translation ) {
+		if ( $translation['language'] === $download ) {
+			$translation_to_load = true;
+			break;
+		}
+	}
+
+	if ( empty( $translation_to_load ) ) {
+		return false;
+	}
+	$translation = (object) $translation;
+
+	require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
+	$skin = new Automatic_Upgrader_Skin;
+	$upgrader = new Language_Pack_Upgrader( $skin );
+	$translation->type = 'core';
+	/**
+	 * @todo failures (such as non-direct FS)
+	 */
+	$result = $upgrader->upgrade( $translation, array( 'clear_update_cache' => false ) );
+	return $translation->language;
+}
+
+/**
+ * Load a translation during the install process.
+ *
+ * @since 4.0.0
+ *
+ * @see load_textdomain()
+ *
+ * @param string $translation Translation to load.
+ * @return string|bool Returns the language code if successfully loaded,
+ *                     or false on failure.
+ */
+function wp_install_load_language( $translation ) {
+	if ( ! empty( $translation ) ) {
+		if ( in_array( $translation, get_available_languages() ) ) {
+			$translation_to_load = $translation;
+		}
+	}
+
+	if ( empty( $translation_to_load ) ) {
+		return false;
+	}
+
+	unload_textdomain( 'default' ); // Start over.
+	load_textdomain( 'default', WP_LANG_DIR . "/{$translation_to_load}.mo" );
+	load_textdomain( 'default', WP_LANG_DIR . "/admin-{$translation_to_load}.mo" );
+	return $translation_to_load;
+}
Index: src/wp-admin/includes/upgrade.php
===================================================================
--- src/wp-admin/includes/upgrade.php	(revision 29579)
+++ src/wp-admin/includes/upgrade.php	(working copy)
@@ -437,6 +437,9 @@
 	if ( $wp_current_db_version < 26691 )
 		upgrade_380();
 
+	if ( $wp_current_db_version < 29600 )
+		upgrade_400();
+
 	maybe_disable_link_manager();
 
 	maybe_disable_automattic_widgets();
@@ -1304,7 +1307,28 @@
 		deactivate_plugins( array( 'mp6/mp6.php' ), true );
 	}
 }
+
 /**
+ * Execute changes made in WordPress 4.0.0.
+ *
+ * @since 4.0.0
+ */
+function upgrade_400() {
+	global $wp_current_db_version;
+	if ( $wp_current_db_version < 29600 ) {
+		if ( ! is_multisite() && false === get_option( 'WPLANG' ) ) {
+			if (
+				defined( 'WPLANG' ) && ( '' !== WPLANG ) && ( 'en_US' !== WPLANG ) &&
+				in_array( WPLANG, get_available_languages() ) ) {
+				update_option( 'WPLANG', WPLANG );
+			} else {
+				update_option( 'WPLANG', '' );
+			}
+		}
+	}
+}
+
+/**
  * Execute network level changes
  *
  * @since 3.0.0
@@ -1419,7 +1443,7 @@
  */
 function maybe_create_table($table_name, $create_ddl) {
 	global $wpdb;
-	
+
 	$query = $wpdb->prepare( "SHOW TABLES LIKE %s", $wpdb->esc_like( $table_name ) );
 
 	if ( $wpdb->get_var( $query ) == $table_name ) {
@@ -2192,145 +2216,3 @@
 	dbDelta( $ms_queries );
 }
 endif;
-
-/**
- * Output the input fields for the language selection form on the installation screen.
- *
- * @since 4.0.0
- *
- * @see wp_get_available_translations_from_api()
- * 
- * @param array $languages Array of available languages (populated via the Translations API).
- */
-function wp_install_language_form( $languages ) {
-	$installed_languages = get_available_languages();
-
-	echo "<label class='screen-reader-text' for='language'>Select a default language</label>\n";
-	echo "<select size='14' name='language' id='language'>\n";
-	echo '<option value="" lang="en" selected="selected" data-continue="Continue" data-installed="1">English (United States)</option>';
-	echo "\n";
-
-	if ( defined( 'WPLANG' ) && ( '' !== WPLANG ) && ( 'en_US' !== WPLANG ) ) {
-		if ( isset( $languages[ WPLANG ] ) ) {
-			$language = $languages[ WPLANG ];
-			echo '<option value="' . esc_attr( $language['language'] ) . '" lang="' . esc_attr( $language['iso'][1] ) . '">' . esc_html( $language['native_name'] ) . "</option>\n";
-		}
-	}
-
-	foreach ( $languages as $language ) {
-		printf( '<option value="%s" lang="%s" data-continue="%s"%s>%s</option>' . "\n",
-			esc_attr( $language['language'] ),
-			esc_attr( $language['iso'][1] ),
-			esc_attr( $language['strings']['continue'] ),
-			in_array( $language['language'], $installed_languages ) ? ' data-installed="1"' : '',
-			esc_html( $language['native_name'] ) );
-	}
-	echo "</select>\n";
-	echo '<p class="step"><span class="spinner"></span><input id="language-continue" type="submit" class="button button-primary button-large" value="Continue" /></p>';
-}
-
-/**
- * Get available translations from the WordPress.org API.
- *
- * @since 4.0.0
- *
- * @see wp_remote_post()
- *
- * @return array Array of translations, each an array of data.
- */
-function wp_get_available_translations_from_api() {
-	$url = 'http://api.wordpress.org/translations/core/1.0/';
-	if ( wp_http_supports( array( 'ssl' ) ) ) {
-		$url = set_url_scheme( $url, 'https' );
-	}
-
-	$options = array(
-		'timeout' => 3,
-		'body' => array( 'version' => $GLOBALS['wp_version'] ),
-	);
-
-	$response = wp_remote_post( $url, $options );
-	$body = wp_remote_retrieve_body( $response );
-	if ( $body && $body = json_decode( $body, true ) ) {
-		$translations = array();
-		// Key the array with the language code for now
-		foreach ( $body['translations'] as $translation ) {
-			$translations[ $translation['language'] ] = $translation;
-		}
-		return $translations;
-	}
-	return false;
-}
-
-/**
- * Download a language pack.
- *
- * @since 4.0.0
- *
- * @see wp_get_available_translations_from_api()
- *
- * @param string $download Language code to download.
- * @return string|bool Returns the language code if successfully downloaded
- *                     (or already installed), or false on failure.
- */
-function wp_install_download_language_pack( $download ) {
-	// Check if the translation is already installed.
-	if ( in_array( $download, get_available_languages() ) ) {
-		return $download;
-	}
-
-	// Confirm the translation is one we can download.
-	$translations = wp_get_available_translations_from_api();
-	if ( ! $translations ) {
-		return false;
-	}
-	foreach ( $translations as $translation ) {
-		if ( $translation['language'] === $download ) {
-			$translation_to_load = true;
-			break;
-		}
-	}
-
-	if ( empty( $translation_to_load ) ) {
-		return false;
-	}
-	$translation = (object) $translation;
-
-	require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
-	$skin = new Automatic_Upgrader_Skin;
-	$upgrader = new Language_Pack_Upgrader( $skin );
-	$translation->type = 'core';
-	/**
-	 * @todo failures (such as non-direct FS)
-	 */
-	$upgrader->upgrade( $translation, array( 'clear_update_cache' => false ) );
-	return $translation->language;
-}
-
-/**
- * Load a translation during the install process.
- *
- * @since 4.0.0
- *
- * @see load_textdomain()
- *
- * @param string $translation Translation to load.
- * @return string|bool Returns the language code if successfully loaded,
- *                     or false on failure.
- */
-function wp_install_load_language( $translation ) {
-	if ( ! empty( $translation ) ) {
-		if ( in_array( $translation, get_available_languages() ) ) {
-			$translation_to_load = $translation;
-		}
-	}
-
-	if ( empty( $translation_to_load ) ) {
-		return false;
-	}
-
-	unload_textdomain( 'default' ); // Start over.
-	load_textdomain( 'default', WP_LANG_DIR . "/{$translation_to_load}.mo" );
-	load_textdomain( 'default', WP_LANG_DIR . "/admin-{$translation_to_load}.mo" );
-	return $translation_to_load;
-}
Index: src/wp-admin/install.php
===================================================================
--- src/wp-admin/install.php	(revision 29579)
+++ src/wp-admin/install.php	(working copy)
@@ -38,6 +38,9 @@
 /** Load WordPress Administration Upgrade API */
 require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
 
+/** Load WordPress Translation Install API */
+require_once( ABSPATH . 'wp-admin/includes/translation-install.php' );
+
 /** Load wpdb */
 require_once( ABSPATH . WPINC . '/wp-db.php' );
 
@@ -179,7 +182,7 @@
 switch($step) {
 	case 0: // Step 0
 
-		if ( empty( $_GET['language'] ) && ( $languages = wp_get_available_translations_from_api() ) ) {
+		if ( empty( $_GET['language'] ) && ( $languages = wp_get_available_translations() ) ) {
 			display_header( 'language-chooser' );
 			echo '<form id="setup" method="post" action="?step=1">';
 			wp_install_language_form( $languages );
Index: src/wp-admin/network/settings.php
===================================================================
--- src/wp-admin/network/settings.php	(revision 29579)
+++ src/wp-admin/network/settings.php	(working copy)
@@ -19,6 +19,29 @@
 $title = __( 'Network Settings' );
 $parent_file = 'settings.php';
 
+/**
+ * Display JavaScript on the page.
+ *
+ * @since 4.0.0
+ */
+function network_settings_add_js() {
+?>
+<script type="text/javascript">
+jQuery(document).ready( function($) {
+	var languageSelect = $( '#WPLANG' );
+	$( 'form' ).submit( function() {
+		// Don't show a spinner for English and installed languages,
+		// as there is nothing to download.
+		if ( ! languageSelect.find( 'option:selected' ).data( 'installed' ) ) {
+			$( this ).find( '.language-chooser .spinner' ).css( 'display', 'inline-block' );
+		}
+	});
+});
+</script>
+<?php
+}
+add_action( 'admin_head', 'network_settings_add_js' );
+
 get_current_screen()->add_help_tab( array(
 		'id'      => 'overview',
 		'title'   => __('Overview'),
@@ -58,6 +81,17 @@
 		'illegal_names', 'limited_email_domains', 'banned_email_domains', 'WPLANG', 'admin_email',
 	);
 
+	// Handle translation install
+	if ( ! empty( $_POST['WPLANG'] ) && ( ! defined( 'DISALLOW_FILE_MODS' ) || ! DISALLOW_FILE_MODS ) ) {
+		require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
+		require_once( ABSPATH . 'wp-admin/includes/translation-install.php' );
+
+		$language = wp_install_download_language_pack( wp_unslash( $_POST['WPLANG'] ) );
+		if ( $language ) {
+			$_POST['WPLANG'] = $language;
+		}
+	}
+
 	foreach ( $options as $option_name ) {
 		if ( ! isset($_POST[$option_name]) )
 			continue;
@@ -102,7 +136,7 @@
 					<input name="admin_email" type="email" id="admin_email" class="regular-text" value="<?php echo esc_attr( get_site_option( 'admin_email' ) ) ?>" />
 					<p class="description">
 						<?php _e( 'This email address will receive notifications. Registration and support emails will also come from this address.' ); ?>
-					</p>	
+					</p>
 				</td>
 			</tr>
 		</table>
@@ -165,7 +199,7 @@
 <?php echo esc_textarea( $limited_email_domains == '' ? '' : implode( "\n", (array) $limited_email_domains ) ); ?></textarea>
 					<p class="description">
 						<?php _e( 'If you want to limit site registrations to certain domains. One domain per line.' ) ?>
-					</p>	
+					</p>
 				</td>
 			</tr>
 
@@ -231,7 +265,7 @@
 <?php echo esc_textarea( get_site_option( 'first_comment' ) ) ?></textarea>
 					<p class="description">
 						<?php _e( 'The first comment on a new site.' ) ?>
-					</p>	
+					</p>
 				</td>
 			</tr>
 			<tr>
@@ -273,25 +307,29 @@
 			</tr>
 		</table>
 
-<?php
-		$languages = get_available_languages();
-		if ( ! empty( $languages ) ) {
-			$lang = get_site_option( 'WPLANG' );
-?>
 		<h3><?php _e( 'Language Settings' ); ?></h3>
 		<table class="form-table">
-				<tr>
-					<th><label for="WPLANG"><?php _e( 'Default Language' ); ?></label></th>
-					<td>
-						<select name="WPLANG" id="WPLANG">
-							<?php mu_dropdown_languages( $languages, get_site_option( 'WPLANG' ) ); ?>
-						</select>
-					</td>
-				</tr>
+			<tr>
+				<th><label for="WPLANG"><?php _e( 'Default Language' ); ?></label></th>
+				<td>
+					<?php
+					$lang = get_site_option( 'WPLANG' );
+					if ( ! in_array( $lang, get_available_languages() ) ) {
+						$lang = '';
+					}
+
+					echo '<div class="language-chooser">';
+					wp_dropdown_languages( array(
+						'name'     => 'WPLANG',
+						'id'       => 'WPLANG',
+						'selected' => $lang,
+					) );
+					echo '<span class="spinner"></span>';
+					echo '</div>';
+					?>
+				</td>
+			</tr>
 		</table>
-<?php
-		} // languages
-?>
 
 		<h3><?php _e( 'Menu Settings' ); ?></h3>
 		<table id="menu" class="form-table">
@@ -324,7 +362,7 @@
 			</tr>
 		</table>
 
-		<?php 
+		<?php
 		/**
 		 * Fires at the end of the Network Settings form, before the submit button.
 		 *
Index: src/wp-admin/options-general.php
===================================================================
--- src/wp-admin/options-general.php	(revision 29579)
+++ src/wp-admin/options-general.php	(working copy)
@@ -50,6 +50,15 @@
 					date : format.val()
 				}, function(d) { format.siblings('.spinner').hide(); format.siblings('.example').text(d); } );
 		});
+
+		var languageSelect = $( '#WPLANG' );
+		$( 'form' ).submit( function() {
+			// Don't show a spinner for English and installed languages,
+			// as there is nothing to download.
+			if ( ! languageSelect.find( 'option:selected' ).data( 'installed' ) ) {
+				$( this ).find( '.language-chooser .spinner' ).css( 'display', 'inline-block' );
+			}
+		});
 	});
 //]]>
 </script>
@@ -302,24 +311,36 @@
 </select></td>
 </tr>
 <?php do_settings_fields('general', 'default'); ?>
-<?php
-	$languages = get_available_languages();
-	if ( $languages ) :
-?>
-	<tr>
-		<th width="33%" scope="row"><label for="WPLANG"><?php _e('Site Language') ?></label></th>
-		<td>
-			<?php wp_dropdown_languages( array(
-				'name'      => 'WPLANG',
-				'id'        => 'WPLANG',
-				'selected'  => get_option( 'WPLANG' ),
-				'languages' => $languages,
-			) ); ?>
-		</td>
-	</tr>
-<?php
-	endif;
-?>
+<tr>
+	<th width="33%" scope="row"><label for="WPLANG"><?php _e( 'Site Language' ); ?></label></th>
+	<td>
+		<?php
+		$locale = get_locale();
+		// Check if current locale is still installed. en_US will fail this test, but that's okay.
+		if ( ! in_array( $locale, get_available_languages() ) ) {
+			$locale = '';
+		}
+
+		echo '<div class="language-chooser">';
+		wp_dropdown_languages( array(
+			'name'     => 'WPLANG',
+			'id'       => 'WPLANG',
+			'selected' => $locale,
+		) );
+		echo '<span class="spinner"></span>';
+		echo '</div>';
+
+		// Add note about deprecated WPLANG constant
+		if ( defined( 'WPLANG' ) && ( '' !== WPLANG ) ) {
+			?>
+			<p class="description">
+				<?php _e( '<strong>Note:</strong> Language does no longer persist on the <code>WPLANG</code> constant in your <code>wp-config.php</code> file. Feel free to remove it.' ); ?>
+			</p>
+			<?php
+		}
+		?>
+	</td>
+</tr>
 </table>
 
 <?php do_settings_sections('general'); ?>
Index: src/wp-admin/options.php
===================================================================
--- src/wp-admin/options.php	(revision 29579)
+++ src/wp-admin/options.php	(working copy)
@@ -151,8 +151,8 @@
 		$options = $whitelist_options[ $option_page ];
 	}
 
-	// Handle custom date/time formats
 	if ( 'general' == $option_page ) {
+		// Handle custom date/time formats.
 		if ( !empty($_POST['date_format']) && isset($_POST['date_format_custom']) && '\c\u\s\t\o\m' == wp_unslash( $_POST['date_format'] ) )
 			$_POST['date_format'] = $_POST['date_format_custom'];
 		if ( !empty($_POST['time_format']) && isset($_POST['time_format_custom']) && '\c\u\s\t\o\m' == wp_unslash( $_POST['time_format'] ) )
@@ -163,6 +163,30 @@
 			$_POST['gmt_offset'] = preg_replace('/UTC\+?/', '', $_POST['gmt_offset']);
 			$_POST['timezone_string'] = '';
 		}
+
+		// Handle translation install.
+		if ( isset( $_POST['WPLANG'] ) ) {
+			require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
+			require_once( ABSPATH . 'wp-admin/includes/translation-install.php' );
+
+			if ( ! empty( $_POST['WPLANG'] ) &&
+				( ! is_multisite() || is_super_admin() ) &&
+				( ! defined( 'DISALLOW_FILE_MODS' ) || ! DISALLOW_FILE_MODS )
+			) {
+				$language = wp_install_download_language_pack( wp_unslash( $_POST['WPLANG'] ) );
+				if ( $language ) {
+					$_POST['WPLANG'] = $language;
+				}
+			}
+
+			// Load new language to translate "Settings saved" message.
+			if ( '' === $_POST['WPLANG'] ) {
+				// English is selected
+				unload_textdomain( 'default' );
+			} else {
+				wp_install_load_language( wp_unslash( $_POST['WPLANG'] ) );
+			}
+		}
 	}
 
 	if ( $options ) {
Index: src/wp-admin/setup-config.php
===================================================================
--- src/wp-admin/setup-config.php	(revision 29579)
+++ src/wp-admin/setup-config.php	(working copy)
@@ -32,8 +32,12 @@
 
 require( ABSPATH . 'wp-settings.php' );
 
-require( ABSPATH . 'wp-admin/includes/upgrade.php' );
+/** Load WordPress Administration Upgrade API */
+require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
 
+/** Load WordPress Translation Install API */
+require_once( ABSPATH . 'wp-admin/includes/translation-install.php' );
+
 // Support wp-config-sample.php one level up, for the develop repo.
 if ( file_exists( ABSPATH . 'wp-config-sample.php' ) )
 	$config_file = file( ABSPATH . 'wp-config-sample.php' );
@@ -86,7 +90,7 @@
 switch($step) {
 	case -1:
 
-		if ( empty( $_GET['language'] ) && ( $languages = wp_get_available_translations_from_api() ) ) {
+		if ( empty( $_GET['language'] ) && ( $languages = wp_get_available_translations() ) ) {
 			setup_config_display_header( 'language-chooser' );
 			echo '<form id="setup" method="post" action="?step=0">';
 			wp_install_language_form( $languages );
Index: src/wp-includes/l10n.php
===================================================================
--- src/wp-includes/l10n.php	(revision 29579)
+++ src/wp-includes/l10n.php	(working copy)
@@ -24,7 +24,7 @@
  * @return string The locale of the blog or from the 'locale' hook.
  */
 function get_locale() {
-	global $locale;
+	global $locale, $wp_local_package;
 
 	if ( isset( $locale ) ) {
 		/**
@@ -37,27 +37,35 @@
 		return apply_filters( 'locale', $locale );
 	}
 
-	// WPLANG is defined in wp-config.
-	if ( defined( 'WPLANG' ) )
+	// WPLANG was defined in wp-config.
+	if ( defined( 'WPLANG' ) ) {
 		$locale = WPLANG;
+	}
 
+	if ( isset( $wp_local_package ) ) {
+		$locale = $wp_local_package;
+	}
+
 	// If multisite, check options.
 	if ( is_multisite() ) {
 		// Don't check blog option when installing.
-		if ( defined( 'WP_INSTALLING' ) || ( false === $ms_locale = get_option( 'WPLANG' ) ) )
-			$ms_locale = get_site_option('WPLANG');
+		if ( defined( 'WP_INSTALLING' ) || ( false === $ms_locale = get_option( 'WPLANG' ) ) ) {
+			$ms_locale = get_site_option( 'WPLANG' );
+		}
 
-		if ( $ms_locale !== false )
+		if ( $ms_locale !== false ) {
 			$locale = $ms_locale;
+		}
 	} elseif ( ! defined( 'WP_INSTALLING' ) ) {
 		$db_locale = get_option( 'WPLANG' );
-		if ( $db_locale ) {
+		if ( $db_locale !== false ) {
 			$locale = $db_locale;
 		}
 	}
 
-	if ( empty( $locale ) )
+	if ( empty( $locale ) ) {
 		$locale = 'en_US';
+	}
 
 	/** This filter is documented in wp-includes/l10n.php */
 	return apply_filters( 'locale', $locale );
@@ -818,26 +826,68 @@
 }
 
 /**
- * Language selector. More to come.
+ * Language selector.
  *
  * @since 4.0.0
  *
  * @see get_available_languages()
+ * @see wp_get_available_translations()
  *
  * @param array $args Optional arguments. Default empty array.
  */
 function wp_dropdown_languages( $args = array() ) {
-	if ( isset( $args['languages'] ) ) {
-		$languages = $args['languages'];
-	} else {
-		$languages = get_available_languages();
+	require_once( ABSPATH . 'wp-admin/includes/translation-install.php' );
+
+	$locales = get_available_languages();
+	$translations = wp_get_available_translations();
+
+	/*
+	 * get_available_languages() just returns the locales. Find the locale in
+	 * $translations to get the native name. Fall back to locale.
+	 */
+	$languages = array();
+	foreach ( $locales as $locale ) {
+		if ( isset( $translations[ $locale ] ) ) {
+			$translation = $translations[ $locale ];
+			$languages[ $locale ] = array(
+				'language'    => $translation['language'],
+				'native_name' => $translation['native_name'],
+			);
+		} else {
+			$languages[ $locale ] = array(
+				'language'    => $locale,
+				'native_name' => $locale,
+			);
+		}
 	}
 
+	// Remove installed languages from available translations.
+	$translations = array_diff_key( $translations, $languages );
+
 	printf( '<select name="%s" id="%s">', esc_attr( $args['name'] ), esc_attr( $args['id'] ) );
-	echo '<option value="">en_US</option>';
+
+	$structure = array();
+
+	// List installed languages.
+	$structure[] = '<optgroup label="' . esc_attr_x( 'Installed', 'translations' ) . '">';
+	$structure[] = '<option value="" data-installed="1">English (United States)</option>';
 	foreach ( $languages as $language ) {
-		$selected = selected( $language, $args['selected'], false );
-		echo '<option value="' . esc_attr( $language ) .'"' . $selected . '>' . $language . '</option>';
+		$selected = selected( $language['language'], $args['selected'], false );
+		$structure[] = '<option value="' . esc_attr( $language['language'] ) .'"' . $selected . ' data-installed="1">' . esc_html( $language['native_name'] ) . '</option>';
 	}
+	$structure[] = '</optgroup>';
+
+	// List available translations.
+	if ( ! empty( $translations ) && ( ! is_multisite() || is_super_admin() ) && ( ! defined( 'DISALLOW_FILE_MODS' ) || ! DISALLOW_FILE_MODS ) ) {
+		$structure[] = '<optgroup label="' . esc_attr_x( 'Available', 'translations' ) . '">';
+		foreach ( $translations as $translation ) {
+			$selected = selected( $translation['language'], $args['selected'], false );
+			$structure[] = '<option value="' . esc_attr( $translation['language'] ) .'"' . $selected . '>' . esc_html( $translation['native_name'] ) . '</option>';
+		}
+		$structure[] = '</optgroup>';
+	}
+
+	echo join( "\n", $structure );
+
 	echo '</select>';
 }
Index: src/wp-includes/load.php
===================================================================
--- src/wp-includes/load.php	(revision 29579)
+++ src/wp-includes/load.php	(working copy)
@@ -776,12 +776,6 @@
 	$locales = $locations = array();
 
 	while ( true ) {
-		if ( defined( 'WPLANG' ) ) {
-			if ( '' == WPLANG )
-				break;
-			$locales[] = WPLANG;
-		}
-
 		if ( isset( $wp_local_package ) )
 			$locales[] = $wp_local_package;
 
Index: src/wp-includes/version.php
===================================================================
--- src/wp-includes/version.php	(revision 29579)
+++ src/wp-includes/version.php	(working copy)
@@ -11,7 +11,7 @@
  *
  * @global int $wp_db_version
  */
-$wp_db_version = 29188;
+$wp_db_version = 29600;
 
 /**
  * Holds the TinyMCE version
Index: wp-config-sample.php
===================================================================
--- wp-config-sample.php	(revision 29579)
+++ wp-config-sample.php	(working copy)
@@ -62,16 +62,6 @@
 $table_prefix  = 'wp_';
 
 /**
- * WordPress Localized Language, defaults to English.
- *
- * Change this to localize WordPress. A corresponding MO file for the chosen
- * language must be installed to wp-content/languages. For example, install
- * de_DE.mo to wp-content/languages and set WPLANG to 'de_DE' to enable German
- * language support.
- */
-define('WPLANG', '');
-
-/**
  * For developers: WordPress debugging mode.
  *
  * Change this to true to enable the display of notices during development.
