+ case 0: // Step 0
+
+ if ( wp_can_install_language_pack() && empty( $language ) && ( $languages = wp_get_available_translations() ) ) {
+ display_header( 'language-chooser' );
+ echo '<form id="setup" method="post" action="?step=1">';
+ wp_install_language_form( $languages );
+ echo '</form>';
+ break;
+ }
+
+ // Deliberately fall through if we can't reach the translations API.
+
+ case 1: // Step 1, direct link or from language chooser.
+ if ( ! empty( $language ) ) {
+ $loaded_language = wp_download_language_pack( $language );
+ if ( $loaded_language ) {
+ load_default_textdomain( $loaded_language );
+ $GLOBALS['wp_locale'] = new WP_Locale();
+ }
+ }
+
+ display_header();