1 language.install language_update_1002()

Convert the language database table to config.

Related topics

File

core/modules/language/language.install, line 165
Install, update and uninstall functions for the language module.

Code

function language_update_1002() {
  if (db_table_exists('language')) {
    $languages = db_query("SELECT * FROM {language}")->fetchAllAssoc('langcode');
    $config = config('language.settings');
    $config->set('_config_static', TRUE);
    $config->set('languages', $languages);
    $config->save();

    db_drop_table('language');
  }
}