update de version + corrections bugs dans translate

This commit is contained in:
Deltacms 2024-02-21 09:11:39 +01:00
parent 56cad67a06
commit 1e8859cd8a
10 changed files with 49 additions and 22 deletions

View File

@ -8,7 +8,7 @@
- Editeur Tinymce : Tinymce passe en version 5.10.9. Les utlisateurs du module Snipcart devront faire une mise à jour vers Snipcart V30.
- Corrections :
- Menu : suppression de l'aléa lors du passage de petit écran à grand écran,
- Theme / Bannière / option contenu personnalisé : les couleurs dans l'éditeur Tinymce sont celles réglés dans cette option.
- Theme / Bannière / option contenu personnalisé : les couleurs dans l'éditeur Tinymce sont celles réglées dans cette option.
- Sur le site :
- Snipcart V30 : mise à jour indispensable pour compatibilité avec Deltacms 5.0.01

View File

@ -180,13 +180,18 @@ if ($this->getData(['core', 'dataVersion']) < 4502) {
$this->setData(['core', 'dataVersion', 4502]);
}
if ($this->getData(['core', 'dataVersion']) < 5001) {
$this->setData([ 'config', 'social', 'comment', 'button', '']);
$this->setData([ 'config', 'social', 'comment', 'group', '']);
$this->setData([ 'config', 'social', 'comment', 'user', '']);
$this->setData([ 'config', 'social', 'comment', 'subject', '']);
$this->setData([ 'config', 'social', 'comment', 'captcha', true]);
$this->setData([ 'config', 'social', 'comment', 'nbItemPage', '3']);
copy ('core/module/install/ressource/database_fr/base/comment.json', self::DATA_DIR . 'base' . '/comment.json');
$this->setData(['locale', 'pageComment', 'writeComment', 'Ecrire un commentaire']);
$this->setData(['locale', 'pageComment', 'commentName', 'Nom ou pseudo']);
$this->setData(['locale', 'pageComment', 'comment', 'Commentaire']);
$this->setData(['locale', 'pageComment', 'submit', 'Envoyer']);
$this->setData(['locale', 'pageComment', 'link', ', le']);
$this->setData(['locale', 'pageComment', 'page', 'Page']);
foreach( $this->getData(['config', 'i18n']) as $key => $value){
if( $value === 'site') copy ('core/module/install/ressource/database_fr/base/comment.json', self::DATA_DIR . $key . '/comment.json');
}

View File

@ -501,7 +501,6 @@ class config extends common {
'githubId' => $this->getInput('socialGithubId'),
'headFacebook' => $this->getInput('socialHeadFacebook', helper::FILTER_BOOLEAN),
'comment' => [
'button' => $this->getInput('socialConfigButton'),
'group' => $this->getInput('socialConfigGroup'),
'user' => $this->getInput('socialConfigUser'),
'subject' => $this->getInput('socialConfigSubject'),

View File

@ -19,7 +19,6 @@ class init extends common {
'youtubeUserId' => '',
'githubId' => '',
'comment' => [
'button' => '',
'group' => '',
'user' => '',
'subject' => '',

View File

@ -7,7 +7,7 @@ $text['core_translate_view']['copy'][3] = 'Site copy (written translations)';
$text['core_translate_view']['copy'][4] = 'Pages and modules of';
$text['core_translate_view']['copy'][5] = 'to';
$text['core_translate_view']['copy'][6] = 'All pages';
$text['core_translate_view']['copy'][7] = 'A page, subpage or bar';
$text['core_translate_view']['copy'][7] = 'A page, subpage or bar of the site in language ';
$text['core_translate_view']['copy'][8] = 'Page type: title in menu (full title - identifier). Copying an existing page to the target folder overwrites this page, read help.';
$text['core_translate_view']['copy'][9] = 'Copy the bars associated with the page';
$text['core_translate_view']['copy'][10] = 'Copying the bars of a page is a delicate operation, read the help';

View File

@ -7,7 +7,7 @@ $text['core_translate_view']['copy'][3] = 'Copia del sitio (traducciones redacta
$text['core_translate_view']['copy'][4] = 'Páginas y módulos';
$text['core_translate_view']['copy'][5] = 'Para';
$text['core_translate_view']['copy'][6] = 'Todas las páginas';
$text['core_translate_view']['copy'][7] = 'Una página, subpágina o barra';
$text['core_translate_view']['copy'][7] = 'Una página, subpágina o barra del sitio en idioma ';
$text['core_translate_view']['copy'][8] = 'Tipo de página: título en el menú (título completo - identificador). Copiar una página existente a la carpeta de destino sobrescribe esta página, lea la ayuda.';
$text['core_translate_view']['copy'][9] = 'Copiar las barras asociadas con la página';
$text['core_translate_view']['copy'][10] = 'Copiar las barras de una página es una operación delicada, lea la ayuda';

View File

@ -8,7 +8,7 @@ $text['core_translate_view']['copy'][4] = 'Pages et les modules de';
$text['core_translate_view']['copy'][5] = 'Vers';
$text['core_translate_view']['copy'][6] = 'Toutes les pages';
$text['core_translate_view']['copy'][7] = 'Une page, une sous-page ou une barre';
$text['core_translate_view']['copy'][7] = 'Une page, une sous-page ou une barre du site en langue ';
$text['core_translate_view']['copy'][8] = 'Type de page : titre dans le menu ( titre complet - identifiant). Copier une page existante dans le dossier cible écrase cette page, lire l\'aide.';
$text['core_translate_view']['copy'][9] = 'Copier les barres associées à la page';
$text['core_translate_view']['copy'][10] = 'Copier les barres d\'une page est une opération délicate, lire l\'aide';

View File

@ -61,7 +61,16 @@ class translate extends common {
if ($this->isPost()) {
// Initialisation
$success = false;
$copyFrom = $this->getInput('translateFormCopySource');
if( $this->getInput('translateCopyAllPages') === '1'){
$copyFrom = $this->getInput('translateFormCopySource');
} else {
if( $this->getInput('DELTA_I18N_SITE') === '' || $this->getInput('DELTA_I18N_SITE')=== null || $this->getInput('DELTA_I18N_SITE') === 'base'){
$copyFrom = 'base';
}
else{
$copyFrom = $this->getInput('DELTA_I18N_SITE');
}
}
$toCreate = $this->getInput('translateFormCopyTarget');
$this->setData([ 'config', 'i18n', 'CopyTarget', $toCreate]);
// Tableau des langues installées
@ -184,8 +193,12 @@ class translate extends common {
}
}
// Langues cibles base en plus
self::$languagesInstalled = array_merge(['base' => $text['core_translate']['copy'][5] ],self::$languagesTarget);
// Langues cibles avec dossier existant et base en plus
$installed = self::$languagesTarget;
foreach( $installed as $key=>$value){
if( ! is_dir( self::DATA_DIR.$key )) unset( $installed[$key]);
}
self::$languagesInstalled = array_merge(['base' => $text['core_translate']['copy'][5] ],$installed);
// Valeurs en sortie
$this->addOutput([

View File

@ -4,8 +4,11 @@
$('#translateCopyAllPages').on("change", function() {
if($(this).is(":checked")) {
$(".pagesList").css("display","none");
$('.copyAll').css("display","");
}
else {
$(".pagesList").css("display","");
$('.copyAll').css("display","none");
}
}).trigger("change");
}).trigger("change");

View File

@ -1,6 +1,14 @@
<?php echo template::formOpen('translateFormCopy');
// Lexique
include('./core/module/translate/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_translate.php');
// drapeau pour la langue d'origine ou la langue en traduction rédigée
if( $this->getInput('DELTA_I18N_SITE') === '' || $this->getInput('DELTA_I18N_SITE')=== null || $this->getInput('DELTA_I18N_SITE') === 'base'){
$flag = $this->getData(['config', 'i18n', 'langBase']);
}
else{
$flag = $this->getInput('DELTA_I18N_SITE');
}
?>
<div class="row">
<div class="col2">
@ -31,11 +39,21 @@ include('./core/module/translate/lang/'. $this->getData(['config', 'i18n', 'lang
<div class="block">
<div class="blockTitle"><?php echo $text['core_translate_view']['copy'][3]; ?></div>
<div class="row">
<div class="col6">
<div class="col6 copyAll">
<?php echo template::select('translateFormCopySource', $module::$languagesInstalled, [
'label' => $text['core_translate_view']['copy'][4]
]); ?>
</div>
<div class="col6 pagesList">
<?php
asort($module::$pagesList);
echo template::select('translateCopyPage', $module::$pagesList, [
'label' => $text['core_translate_view']['copy'][7].template::flag($flag, '20px'),
'selected' => '',
'help' => $text['core_translate_view']['copy'][8],
'ksort' => false
]); ?>
</div>
<div class="col6">
<?php echo template::select('translateFormCopyTarget', $module::$languagesTarget, [
'label' => $text['core_translate_view']['copy'][5],
@ -49,16 +67,6 @@ include('./core/module/translate/lang/'. $this->getData(['config', 'i18n', 'lang
'checked' => ''
]); ?>
</div>
<div class="col4 pagesList">
<?php
asort($module::$pagesList);
echo template::select('translateCopyPage', $module::$pagesList, [
'label' => $text['core_translate_view']['copy'][7],
'selected' => '',
'help' => $text['core_translate_view']['copy'][8],
'ksort' => false
]); ?>
</div>
<div class="col4 offset1 pagesList">
<?php echo template::checkbox('translateCopyBarAuto', true, $text['core_translate_view']['copy'][9], [
'checked' => '',