for ($i = 0; $i < count($matches[0]); $i++) {
$langs[$matches[1][$i]] = $matches[2][$i];
}
+ // @todo Somewhere in 2024 or beyond, deprecate the old installer
file_put_contents('../install/langs.php', "<?php \$langs = " . var_export($langs, TRUE) . ";");
+ file_put_contents('../setup/res/languages.php', "<?php\n\n\Civi\Setup::assertRunning();\n\n\$langs = " . var_export($langs, TRUE) . ";");
}
public function generateSchemaStructure(): void {
$m = $e->getModel();
$langs = NULL;
- require implode(DIRECTORY_SEPARATOR, [$m->srcPath, 'install', 'langs.php']);
- foreach ($langs as $locale => $_) {
- if ($locale == 'en_US') {
- continue;
- }
- if (!file_exists(implode(DIRECTORY_SEPARATOR, array($m->srcPath, 'sql', "civicrm_data.$locale.mysql")))) {
- unset($langs[$locale]);
- }
- }
-
+ require implode(DIRECTORY_SEPARATOR, [$m->srcPath, 'setup', 'res', 'languages.php']);
$m->setField('lang', 'options', $langs);
}, \Civi\Setup::PRIORITY_PREPARE);
--- /dev/null
+<?php
+
+\Civi\Setup::assertRunning();
+
+$langs = [
+ 'af_ZA' => 'Afrikaans',
+ 'sq_AL' => 'Albanian',
+ 'ar_EG' => 'Arabic',
+ 'bg_BG' => 'Bulgarian',
+ 'ca_ES' => 'Catalan; Valencian',
+ 'zh_CN' => 'Chinese (China)',
+ 'zh_TW' => 'Chinese (Taiwan)',
+ 'hr_HR' => 'Croatian',
+ 'cs_CZ' => 'Czech',
+ 'da_DK' => 'Danish',
+ 'nl_NL' => 'Dutch (Netherlands)',
+ 'nl_BE' => 'Dutch (Belgium)',
+ 'en_AU' => 'English (Australia)',
+ 'en_CA' => 'English (Canada)',
+ 'en_GB' => 'English (United Kingdom)',
+ 'en_US' => 'English (United States)',
+ 'et_EE' => 'Estonian',
+ 'fi_FI' => 'Finnish',
+ 'fr_CA' => 'French (Canada)',
+ 'fr_FR' => 'French (France)',
+ 'de_DE' => 'German',
+ 'de_CH' => 'German (Swiss)',
+ 'el_GR' => 'Greek, Modern',
+ 'he_IL' => 'Hebrew (modern)',
+ 'hi_IN' => 'Hindi',
+ 'hu_HU' => 'Hungarian',
+ 'id_ID' => 'Indonesian',
+ 'it_IT' => 'Italian',
+ 'ja_JP' => 'Japanese',
+ 'km_KH' => 'Khmer',
+ 'lt_LT' => 'Lithuanian',
+ 'nb_NO' => 'Norwegian Bokmål',
+ 'fa_IR' => 'Persian (Iran)',
+ 'pl_PL' => 'Polish',
+ 'pt_BR' => 'Portuguese (Brazil)',
+ 'pt_PT' => 'Portuguese (Portugal)',
+ 'ro_RO' => 'Romanian, Moldavian, Moldovan',
+ 'ru_RU' => 'Russian',
+ 'sr_RS' => 'Serbian',
+ 'sk_SK' => 'Slovak',
+ 'sl_SI' => 'Slovene',
+ 'es_ES' => 'Spanish; Castilian (Spain)',
+ 'es_MX' => 'Spanish; Castilian (Mexico)',
+ 'es_PR' => 'Spanish; Castilian (Puerto Rico)',
+ 'sv_SE' => 'Swedish',
+ 'te_IN' => 'Telugu',
+ 'th_TH' => 'Thai',
+ 'tr_TR' => 'Turkish',
+ 'uk_UA' => 'Ukrainian',
+ 'vi_VN' => 'Vietnamese',
+];