diff --git a/core/includes/update.inc b/core/includes/update.inc index 42ecc08..4a44b49 100644 --- a/core/includes/update.inc +++ b/core/includes/update.inc @@ -144,22 +144,35 @@ function update_prepare_d8_language() { // Rename the languages table to language. db_rename_table('languages', 'language'); - // Insert module data, so we can enable the module. Calling a full module - // list rebuild so early is costly and complex, so we just have a stop-gap. - $info_defaults = array( - 'dependencies' => array(), - 'description' => '', - 'package' => 'Other', - 'version' => NULL, - 'php' => DRUPAL_MINIMUM_PHP, - 'files' => array(), - 'bootstrap' => 0, - ); - $module_info = drupal_parse_info_file('core/modules/language/language.info'); + // Install the new language module. + update_module_install(array('language')); + } +} + +/** + * Installs new core modules in a Drupal core update. + * + * @param $modules + * Array of module names. + */ +function update_module_install($modules = array()) { + // Insert module data, so we can enable the module. Calling a full module + // list rebuild so early is costly and complex, so we just have a stop-gap. + $info_defaults = array( + 'dependencies' => array(), + 'description' => '', + 'package' => 'Other', + 'version' => NULL, + 'php' => DRUPAL_MINIMUM_PHP, + 'files' => array(), + 'bootstrap' => 0, + ); + foreach ($modules as $module) { + $module_info = drupal_parse_info_file('core/modules/' . $module . '/' . $module . '.info'); db_insert('system') ->fields(array( - 'filename' => 'core/modules/language/language.module', - 'name' => 'language', + 'filename' => 'core/modules/' . $module . '/' . $module . '.module', + 'name' => $module, 'type' => 'module', 'status' => 0, 'bootstrap' => 0, @@ -168,12 +181,12 @@ function update_prepare_d8_language() { 'info' => serialize($module_info + $info_defaults), )) ->execute(); - - // Finally install/enable language module. We need to use the update - // specific version of this function to ensure schema conflicts don't happen - // due to our updated data. - update_module_enable(array('language')); } + + // Finally install/enable the modules. We need to use the update + // specific version of this function to ensure schema conflicts don't happen + // due to our updated data. + update_module_enable($modules); } /** diff --git a/core/modules/language/language.module b/core/modules/language/language.module index 136e8ef..2d77de8 100644 --- a/core/modules/language/language.module +++ b/core/modules/language/language.module @@ -10,6 +10,17 @@ */ function language_help($path, $arg) { switch ($path) { + case 'admin/help#language': + $output = ''; + $output .= '
' . t('The Language module allows you to maintain a list of languages used on your Drupal site for providing language information for content and for interface translation (using the Locale module). For more information, see the online handbook entry for Language module.', array('@language' => 'http://drupal.org/handbook/modules/language/')) . '
'; + $output .= '' . t('With multiple languages enabled, registered users may select their preferred language and authors can assign a specific language to content.') . '
';