diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc index 77ffde53058f6436ba7c8dcbe96c14a499faddf1..a941b0bcb9711e08900e67963b8a9c8cdeef0ebb 100644 --- a/core/includes/install.core.inc +++ b/core/includes/install.core.inc @@ -288,6 +288,14 @@ function install_begin_request(&$install_state) { // This must go after drupal_bootstrap(), which unsets globals! global $conf; + // If we have a language selected and it is not yet saved in the system + // (eg. pre-database data screens we are unable to persistently store + // the default language), we should set language_default so the proper + // language is used to display installer pages as early as possible. + if (!empty($install_state['parameters']['langcode']) && language_default()->langcode != $install_state['parameters']['langcode']) { + $GLOBALS['conf']['language_default'] = array('langcode' => $install_state['parameters']['langcode']); + } + require_once DRUPAL_ROOT . '/core/modules/system/system.install'; require_once DRUPAL_ROOT . '/core/includes/common.inc'; require_once DRUPAL_ROOT . '/core/includes/file.inc'; diff --git a/core/includes/theme.inc b/core/includes/theme.inc index 6ea8af2b9860df449fde930a048fe9fa2a495a87..35527a960cad9574637582ca981d2da89c3afeb0 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -3099,9 +3099,16 @@ function template_preprocess_maintenance_page(&$variables) { * @see template_process_html() */ function template_process_maintenance_page(&$variables) { - $variables['head'] = drupal_get_html_head(); - $variables['css'] = drupal_add_css(); - $variables['styles'] = drupal_get_css(); + $variables['head'] = drupal_get_html_head(); + + // While this code is used in the installer, the language module may not be + // enabled yet (even maybe no database set up yet), but an RTL language + // selected should result in RTL stylesheets loaded properly already. + $variables['css'] = $css = drupal_add_css(); + include_once DRUPAL_ROOT . '/core/modules/language/language.module'; + language_css_alter($css); + $variables['styles'] = drupal_get_css($css); + $variables['scripts'] = drupal_get_js(); }