From c9899a7396094bdcc2a4e6e589f8984b977341ca Mon Sep 17 00:00:00 2001 From: Deltacms Date: Wed, 7 Feb 2024 18:40:32 +0100 Subject: [PATCH] bug translate copy et comment --- core/module/translate/ressource/comment.json | 3 +++ core/module/translate/translate.php | 14 ++++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) create mode 100644 core/module/translate/ressource/comment.json diff --git a/core/module/translate/ressource/comment.json b/core/module/translate/ressource/comment.json new file mode 100644 index 0000000..a6e348a --- /dev/null +++ b/core/module/translate/ressource/comment.json @@ -0,0 +1,3 @@ +{ + "comment": [] +} \ No newline at end of file diff --git a/core/module/translate/translate.php b/core/module/translate/translate.php index 5d22996..cb65edc 100644 --- a/core/module/translate/translate.php +++ b/core/module/translate/translate.php @@ -84,6 +84,7 @@ class translate extends common { $success = (copy (self::DATA_DIR . $copyFrom . '/module.json', self::DATA_DIR . $toCreate . '/module.json') === true && $success === true) ? true : false; $success = (copy (self::DATA_DIR . $copyFrom . '/page.json', self::DATA_DIR . $toCreate . '/page.json') === true && $success === true) ? true : false; $success = ($this->copyDir (self::DATA_DIR . $copyFrom . '/content', self::DATA_DIR . $toCreate . '/content') === true && $success === true) ? true : false; + $success = (copy ('core/module/translate/ressource/comment.json', self::DATA_DIR . $toCreate . '/comment.json') === true && $success === true) ? true : false; // Enregistrer la langue if ($success) { $this->setData(['config', 'i18n', $toCreate, 'site' ]); @@ -100,7 +101,8 @@ class translate extends common { if( !file_exists( self::DATA_DIR . $toCreate . '/page.json')){ $success = (copy (self::DATA_DIR . $copyFrom . '/locale.json', self::DATA_DIR . $toCreate . '/locale.json') === true && $success === true) ? true : false; $success = (copy ('core/module/translate/ressource/module.json', self::DATA_DIR . $toCreate . '/module.json') === true && $success === true) ? true : false; - $success = (copy ('core/module/translate/ressource/page.json', self::DATA_DIR . $toCreate . '/page.json') === true && $success === true) ? true : false; + $success = (copy ('core/module/translate/ressource/page.json', self::DATA_DIR . $toCreate . '/page.json') === true && $success === true) ? true : false; + $success = (copy ('core/module/translate/ressource/comment.json', self::DATA_DIR . $toCreate . '/comment.json') === true && $success === true) ? true : false; } // Si une page de même nom existe déjà elle sera écrasée // Si une page est de nom différent mais de position identique, elle sera ajoutée au menu dans le bon ordre @@ -150,15 +152,15 @@ class translate extends common { } // Classement pages, sous-pages, pages orphelines, barres foreach($pagesList as $page => $pageId) { - if ( $this->getData(['page',$page,'parentPageId']) === '' ) $pagesList[$page][$type] = 'page'; - if ( $this->getData(['page',$page,'parentPageId']) !== '' ) $pagesList[$page][$type] = 'sous-page'; - if ( $this->getData(['page',$page,'position']) === 0 ) $pagesList[$page][$type] = 'page orpheline'; - if ( $this->getData(['page',$page,'block']) === 'bar' ) $pagesList[$page][$type] = 'barre'; + if ( $this->getData(['page',$page,'parentPageId']) === '' ) $pagesList[$page]['type'] = 'page'; + if ( $this->getData(['page',$page,'parentPageId']) !== '' ) $pagesList[$page]['type'] = 'sous-page'; + if ( $this->getData(['page',$page,'position']) === 0 ) $pagesList[$page]['type'] = 'page orpheline'; + if ( $this->getData(['page',$page,'block']) === 'bar' ) $pagesList[$page]['type'] = 'barre'; } //Affichage des pages et mémorisation dans le tableau de sortie self::$pagesList // Type de page : titre court ( titre - identifiant ) foreach($pagesList as $page => $pageId) { - switch ($pagesList[$page][$type]){ + switch ($pagesList[$page]['type']){ case 'page' : self::$pagesList[$page]= $text['core_translate']['copy'][8].$this->getData(['page',$page,'shortTitle']).' ( '. $this->getData(['page',$page,'title']).' - '.$page.' )'; break;