Issue #1260716 by David_Rothstein: Follow-up for improve language onboarding user experience.
parent
82e02137b4
commit
6ea395e685
|
@ -533,8 +533,8 @@ function install_tasks($install_state) {
|
||||||
// Determine whether translation import tasks will need to be performed.
|
// Determine whether translation import tasks will need to be performed.
|
||||||
$needs_translations = count($install_state['translations']) > 1 && !empty($install_state['parameters']['langcode']) && $install_state['parameters']['langcode'] != 'en';
|
$needs_translations = count($install_state['translations']) > 1 && !empty($install_state['parameters']['langcode']) && $install_state['parameters']['langcode'] != 'en';
|
||||||
|
|
||||||
// The first two installation tasks are (by default) language selection and
|
// Start with the core installation tasks that run before handing control
|
||||||
// profile selection.
|
// to the install profile.
|
||||||
$tasks = array(
|
$tasks = array(
|
||||||
'install_select_language' => array(
|
'install_select_language' => array(
|
||||||
'display_name' => st('Choose language'),
|
'display_name' => st('Choose language'),
|
||||||
|
@ -1229,19 +1229,6 @@ function install_select_language(&$install_state) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Allow profile to pre-select the language, skipping the selection.
|
|
||||||
if (isset($install_state['parameters']['profile'])) {
|
|
||||||
$info = install_profile_info($install_state['parameters']['profile']);
|
|
||||||
if (isset($info['langcode'])) {
|
|
||||||
foreach ($files as $file) {
|
|
||||||
if ($info['langcode'] == $file->langcode) {
|
|
||||||
$install_state['parameters']['langcode'] = $file->langcode;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// We still don't have a langcode, so display a form for selecting one.
|
// We still don't have a langcode, so display a form for selecting one.
|
||||||
// Only do this in the case of interactive installations, since this is
|
// Only do this in the case of interactive installations, since this is
|
||||||
// not a real form with submit handlers (the database isn't even set up
|
// not a real form with submit handlers (the database isn't even set up
|
||||||
|
@ -1277,7 +1264,7 @@ function install_select_language_form($form, &$form_state, $files) {
|
||||||
$select_options[$file->langcode] = $standard_languages[$file->langcode][1];
|
$select_options[$file->langcode] = $standard_languages[$file->langcode][1];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// If language not found in standard.inc, display it's langcode
|
// If the language was not found in standard.inc, display its langcode.
|
||||||
$select_options[$file->langcode] = $file->langcode;
|
$select_options[$file->langcode] = $file->langcode;
|
||||||
}
|
}
|
||||||
// Build a list of languages simulated for browser detection.
|
// Build a list of languages simulated for browser detection.
|
||||||
|
|
|
@ -663,7 +663,6 @@ function drupal_rewrite_settings($settings = array()) {
|
||||||
*/
|
*/
|
||||||
function drupal_verify_profile($install_state) {
|
function drupal_verify_profile($install_state) {
|
||||||
$profile = $install_state['parameters']['profile'];
|
$profile = $install_state['parameters']['profile'];
|
||||||
$langcode = $install_state['parameters']['langcode'];
|
|
||||||
|
|
||||||
include_once DRUPAL_ROOT . '/core/includes/file.inc';
|
include_once DRUPAL_ROOT . '/core/includes/file.inc';
|
||||||
include_once DRUPAL_ROOT . '/core/includes/common.inc';
|
include_once DRUPAL_ROOT . '/core/includes/common.inc';
|
||||||
|
@ -1264,13 +1263,8 @@ function install_profile_info($profile, $langcode = 'en') {
|
||||||
'version' => NULL,
|
'version' => NULL,
|
||||||
'hidden' => FALSE,
|
'hidden' => FALSE,
|
||||||
'php' => DRUPAL_MINIMUM_PHP,
|
'php' => DRUPAL_MINIMUM_PHP,
|
||||||
'langcode' => NULL,
|
|
||||||
'custom_language_selection' => FALSE,
|
|
||||||
);
|
);
|
||||||
$info = drupal_parse_info_file("profiles/$profile/$profile.info") + $defaults;
|
$info = drupal_parse_info_file("profiles/$profile/$profile.info") + $defaults;
|
||||||
if (isset($info['langcode'])) {
|
|
||||||
$info['custom_language_selection'] = TRUE;
|
|
||||||
}
|
|
||||||
$info['dependencies'] = array_unique(array_merge(
|
$info['dependencies'] = array_unique(array_merge(
|
||||||
drupal_required_modules(),
|
drupal_required_modules(),
|
||||||
$info['dependencies'],
|
$info['dependencies'],
|
||||||
|
|
|
@ -3350,8 +3350,6 @@ function hook_html_head_alter(&$head_elements) {
|
||||||
* steps within the installation process.
|
* steps within the installation process.
|
||||||
* @param $install_state
|
* @param $install_state
|
||||||
* An array of information about the current installation state.
|
* An array of information about the current installation state.
|
||||||
*
|
|
||||||
* @see install_profile_info()
|
|
||||||
*/
|
*/
|
||||||
function hook_install_tasks_alter(&$tasks, $install_state) {
|
function hook_install_tasks_alter(&$tasks, $install_state) {
|
||||||
// Replace the entire site configuration form provided by Drupal core
|
// Replace the entire site configuration form provided by Drupal core
|
||||||
|
|
Loading…
Reference in New Issue