forked from ZwiiCMS-Team/ZwiiCMS
La langue est initialisée à la création
This commit is contained in:
parent
46a3d36986
commit
ee03f49920
@ -328,15 +328,7 @@ class common
|
|||||||
\setlocale(LC_ALL, self::$i18nContent . '.UTF8');
|
\setlocale(LC_ALL, self::$i18nContent . '.UTF8');
|
||||||
|
|
||||||
// Instanciation de la classe des entrées / sorties
|
// Instanciation de la classe des entrées / sorties
|
||||||
// Récupère les descripteurs
|
$this->jsonDB(self::$i18nContent);
|
||||||
foreach ($this->dataFiles as $keys => $value) {
|
|
||||||
// Constructeur JsonDB;
|
|
||||||
$this->dataFiles[$keys] = new \Prowebcraft\JsonDb([
|
|
||||||
'name' => $keys . '.json',
|
|
||||||
'dir' => $this->dataPath($keys, self::$i18nContent),
|
|
||||||
'backup' => file_exists('site/data/.backup')
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Installation fraîche, initialisation des modules
|
// Installation fraîche, initialisation des modules
|
||||||
if ($this->user === []) {
|
if ($this->user === []) {
|
||||||
@ -595,6 +587,21 @@ class common
|
|||||||
return unlink(self::DATA_DIR . $lang . '/content/' . $this->getData(['page', $page, 'content']));
|
return unlink(self::DATA_DIR . $lang . '/content/' . $this->getData(['page', $page, 'content']));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function jsonDB($lang)
|
||||||
|
{
|
||||||
|
// Instanciation de la classe des entrées / sorties
|
||||||
|
// Récupère les descripteurs
|
||||||
|
foreach ($this->dataFiles as $keys => $value) {
|
||||||
|
// Constructeur JsonDB;
|
||||||
|
$this->dataFiles[$keys] = new \Prowebcraft\JsonDb([
|
||||||
|
'name' => $keys . '.json',
|
||||||
|
'dir' => $this->dataPath($keys, $lang),
|
||||||
|
'backup' => file_exists('site/data/.backup')
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialisation des données
|
* Initialisation des données
|
||||||
* @param string $module : nom du module à générer
|
* @param string $module : nom du module à générer
|
||||||
|
@ -319,13 +319,17 @@ class language extends common
|
|||||||
$this->isPost()
|
$this->isPost()
|
||||||
) {
|
) {
|
||||||
|
|
||||||
// Création du contenu
|
|
||||||
$lang = $this->getInput('translateAddContent');
|
$lang = $this->getInput('translateAddContent');
|
||||||
|
|
||||||
|
// Constructeur pour cette langue
|
||||||
|
$this->jsonDB($lang);
|
||||||
|
|
||||||
|
// Création du contenu
|
||||||
$this->initData('page', $lang);
|
$this->initData('page', $lang);
|
||||||
$this->initData('module', $lang);
|
$this->initData('module', $lang);
|
||||||
$this->initData('locale', $lang);
|
$this->initData('locale', $lang);
|
||||||
|
|
||||||
|
|
||||||
// Valeurs en sortie
|
// Valeurs en sortie
|
||||||
$this->addOutput([
|
$this->addOutput([
|
||||||
'redirect' => helper::baseUrl() . 'language',
|
'redirect' => helper::baseUrl() . 'language',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user