maj des langues après une mise à jour.

This commit is contained in:
Fred Tempez 2023-04-13 11:01:38 +02:00
parent 6a85cae5ad
commit d98963fe9c
2 changed files with 4 additions and 21 deletions

View File

@ -385,13 +385,13 @@ class install extends common
$installedUI = $this->getData(['language']);
// Langues disponibles avec la mise à jour
$store = json_decode(file_get_contents('core/module/install/ressource/i18n/language.json'), true);
$store = $store['language'];
require_once('core/module/install/ressource/defaultdata.php');
$default = init::$defaultData['language'];
foreach ($installedUI as $key => $value) {
if ($store[$key]['version'] > $value['version']) {
if ($default[$key]['version'] > $value['version']) {
copy('core/module/install/ressource/i18n/' . $key . '.json', self::I18N_DIR . $key . '.json');
$this->setData(['language', $key, $store[$key]]);
$this->setData(['language', $key, $default[$key]]);
}
}

View File

@ -1,17 +0,0 @@
{
"languages": {
"fr_FR": {
"version": 12308,
"date": 1681371766
},
"es": {
"version": 12308,
"date": 1681371766
},
"en_EN": {
"version": 12308,
"date": 1681371766
}
}
}