5 * Build a list of available translations.
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.init', function (\Civi\Setup\Event\InitEvent
$e) {
14 \Civi\Setup
::log()->info(sprintf('[%s] Handle %s', basename(__FILE__
), 'init'));
17 * @var \Civi\Setup\Model $m
22 require implode(DIRECTORY_SEPARATOR
, [$m->srcPath
, 'install', 'langs.php']);
23 foreach ($langs as $locale => $_) {
24 if ($locale == 'en_US') {
27 if (!file_exists(implode(DIRECTORY_SEPARATOR
, array($m->srcPath
, 'sql', "civicrm_data.$locale.mysql")))) {
28 unset($langs[$locale]);
32 $m->setField('lang', 'options', $langs);
34 }, \Civi\Setup
::PRIORITY_PREPARE
);