Installation langue de l'UI WIP

This commit is contained in:
Fred Tempez 2022-09-21 10:19:55 +02:00
parent 9a6d4f6911
commit b8424ed6bd
2 changed files with 152 additions and 87 deletions

View File

@ -33,6 +33,48 @@ class install extends common {
public static $newVersion;
// Fichiers des langues de l'interface
public static $i18nFiles = [];
public static $languagesUI = [
'az_AZ' => 'Azərbaycan dili',
'bg_BG' => 'български език',
'ca' => 'Català, valencià',
'cs' => 'čeština, český jazyk',
'da' => 'Dansk',
'de' => 'Deutsch',
'el_GR' => 'ελληνικά',
'en_EN' => 'English',
'es' => 'Español',
'fa' => 'فارسی',
'fr_FR' => 'Français',
'he_IL' => 'Hebrew (Israel)',
'hr' => 'Hrvatski jezik',
'hu_HU' => 'Magyar',
'id' => 'Bahasa Indonesia',
'it' => 'Italiano',
'ja' => '日本',
'lt' => 'Lietuvių kalba',
'mn_MN' => 'монгол',
'nb_NO' => 'Norsk bokmål',
'nn_NO' => 'Norsk nynorsk',
'nl' => 'Nederlands, Vlaams',
'pl' => 'Język polski, polszczyzna',
'pt_BR' => 'Português(Brazil)',
'pt_PT' => 'Português',
'ro' => 'Română',
'ru' => 'Pусский язык',
'sk' => 'Slovenčina',
'sl' => 'Slovenski jezik',
'sv_SE' => 'Svenska',
'th_TH' => 'ไทย',
'tr_TR' => 'Türkçe',
'uk_UA' => 'Yкраїнська мова',
'vi' => 'Tiếng Việt',
'zh_CN' => '中文 (Zhōngwén), 汉语, 漢語',
// source: http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
];
/**
* Installation
@ -162,6 +204,21 @@ class install extends common {
$dataThemes = json_decode($dataThemes, true);
self::$themes = helper::arrayColumn($dataThemes, 'name');
// Liste des langues UI disponibles
if (is_dir(self::I18N_DIR)) {
$dir = getcwd();
chdir(self::I18N_DIR);
$files = glob('*.json');
// Ajouter une clé au tableau avec le code de langue
foreach( $files as $file) {
// La langue est-elle référencée ?
if (array_key_exists(basename($file, '.json'), self::$languagesUI)) {
self::$i18nFiles[basename($file, '.json')] = self::$languagesUI[basename($file, '.json')];
}
}
chdir($dir);
}
// Créer sitemap
$this->createSitemap();
// Mise à jour de la liste des pages pour TinyMCE

View File

@ -2,6 +2,13 @@
<?php echo template::topic('Renseignez les champs ci-dessous pour finaliser l\'installation.'); ?>
</p>
<?php echo template::formOpen('installForm'); ?>
<div class="installStep1">
<div class="row">
<div class="col12">
</div>
</div>
</div>
<div class="installStep2">
<ul class="accordion" data-speed="150">
<li class="accordion-item active">
<h3 class="accordion-title">
@ -100,4 +107,5 @@
]); ?>
</div>
</div>
</div>
<?php echo template::formClose(); ?>