5 * Configure settings on the newly populated database.
8 if (!defined('CIVI_SETUP')) {
9 exit("Installation plugins must only be loaded by the installer.\n");
12 \Civi\Setup
::dispatcher()
13 ->addListener('civi.setup.installDatabase', function (\Civi\Setup\Event\InstallDatabaseEvent
$e) {
14 if ($e->getModel()->lang
) {
15 \Civi\Setup
::log()->info('[SetLanguage.civi-setup.php] Set default language to ' . $e->getModel()->lang
);
16 \Civi
::settings()->set('lcMessages', $e->getModel()->lang
);
18 // Ensure that post-install messages are displayed in the new locale.
19 // Note: This arguably shouldn't be necessary since `$tsLocale` is generally setup before installation,
20 // but it may get trampled during bootstrap.
21 $domain = CRM_Core_BAO_Domain
::getDomain();
22 \CRM_Core_BAO_ConfigSetting
::applyLocale(\Civi
::settings($domain->id
), $domain->locales
);
24 }, \Civi\Setup
::PRIORITY_LATE +
400);