Sélecteur de copie de langues plus souple

This commit is contained in:
fredtempez 2021-01-13 19:35:28 +01:00
parent 606cd9de62
commit 82a42d8daf
3 changed files with 40 additions and 11 deletions

View File

@ -1591,11 +1591,29 @@ class common {
$this->setData(['core', 'dataVersion', 10400]); $this->setData(['core', 'dataVersion', 10400]);
}
// Version 11.0.00
if ($this->getData(['core', 'dataVersion']) < 11000) {
// Mettre à jour les données de langue
$this->setData(['config','translate','scriptGoogle', false ]);
$this->setData(['config','translate','showCredits', false ]);
$this->setData(['config','translate','autoDetect', false ]);
$this->setData(['config','translate','admin', false ]);
$this->setData(['config','translate','fr', false ]);
$this->setData(['config','translate','de', false ]);
$this->setData(['config','translate','en', false ]);
$this->setData(['config','translate','es', false ]);
$this->setData(['config','translate','it', false ]);
$this->setData(['config','translate','nl', false ]);
$this->setData(['config','translate','pt', false ]);
$this->setData(['core', 'dataVersion', 11000]);
}
/** /**
* mettre à jour defaultdata * mettre à jour defaultdata
*/ */
}
} }
} }

View File

@ -50,7 +50,7 @@ class init extends common {
], ],
], ],
'core' => [ 'core' => [
'dataVersion' => 10400, 'dataVersion' => 11000,
'lastBackup' => 0, 'lastBackup' => 0,
'lastClearTmp' => 0, 'lastClearTmp' => 0,
'lastAutoUpdate' => 0, 'lastAutoUpdate' => 0,
@ -98,6 +98,19 @@ class init extends common {
], ],
'module' => [], 'module' => [],
'user' => [], 'user' => [],
'translate' => [
'scriptGoogle' => false,
'showCredits' => false,
'autoDetect' => false,
'admin' => false,
'fr' => 'none',
'de' => 'none',
'en' => 'none',
'es' => 'none',
'it' => 'none',
'nl' => 'none',
'pt' => 'none'
],
'theme' => [ 'theme' => [
'body' => [ 'body' => [
'backgroundColor' => 'rgba(236, 239, 241, 1)', 'backgroundColor' => 'rgba(236, 239, 241, 1)',

View File

@ -24,9 +24,7 @@ class translate extends common {
public static $translateOptions = []; public static $translateOptions = [];
// Liste des langues installées // Liste des langues installées
public static $languagesInstalled = [ public static $languagesInstalled = [];
'fr' => 'Français (fr)',
];
// Liste des langues cibles // Liste des langues cibles
public static $languagesTarget = []; public static $languagesTarget = [];
@ -69,11 +67,11 @@ class translate extends common {
// Tableau des langues installées // Tableau des langues installées
foreach (self::$i18nList as $key => $value) { foreach (self::$i18nList as $key => $value) {
if ($this->getData(['config','translate',$key]) === 'site') { if ($this->getData(['config','translate',$key]) === 'site') {
self::$languagesInstalled[$key] = $value; self::$languagesTarget[$key] = $value;
} }
} }
// Tableau des langues cibles // Langues cibles fr en plus
self::$languagesTarget = array_diff (self::$i18nList,self::$languagesInstalled); self::$languagesInstalled = array_merge(['fr' => 'Français (fr)'],self::$languagesTarget);
// Valeurs en sortie // Valeurs en sortie
$this->addOutput([ $this->addOutput([