From 5550accd83d2a1018ba4e30d6427ab5685b7c1b6 Mon Sep 17 00:00:00 2001 From: Deltacms Date: Wed, 20 Apr 2022 09:25:59 +0200 Subject: [PATCH] Modifications 4104 --- CHANGES.md | 4 + README.md | 2 +- core/core.js.php | 9 +- core/include/update.inc.php | 8 +- core/module/config/config.php | 11 +- core/module/install/ressource/br/accueil.html | 6 + core/module/install/ressource/ca/accueil.html | 6 + core/module/install/ressource/co/accueil.html | 6 + .../database_en/base/content/blog.html | 2 +- .../database_en/base/content/galeries.html | 2 +- core/module/install/ressource/defaultdata.php | 12 +- core/module/install/ressource/eu/accueil.html | 6 + core/module/translate/translate.php | 49 ++-- core/module/translate/view/index/index.js.php | 10 + core/module/translate/view/index/index.php | 44 ++- core/vendor/i18n/png/br.png | Bin 0 -> 470 bytes core/vendor/i18n/png/ca.png | Bin 0 -> 176 bytes core/vendor/i18n/png/co.png | Bin 0 -> 749 bytes core/vendor/i18n/png/eu.png | Bin 0 -> 873 bytes core/vendor/tinymce/langs/ca.js | 261 ++++++++++++++++++ core/vendor/tinymce/langs/eu.js | 261 ++++++++++++++++++ module/blog/view/article/article.php | 14 +- 22 files changed, 680 insertions(+), 33 deletions(-) create mode 100644 core/module/install/ressource/br/accueil.html create mode 100644 core/module/install/ressource/ca/accueil.html create mode 100644 core/module/install/ressource/co/accueil.html create mode 100644 core/module/install/ressource/eu/accueil.html create mode 100644 core/vendor/i18n/png/br.png create mode 100644 core/vendor/i18n/png/ca.png create mode 100644 core/vendor/i18n/png/co.png create mode 100644 core/vendor/i18n/png/eu.png create mode 100644 core/vendor/tinymce/langs/ca.js create mode 100644 core/vendor/tinymce/langs/eu.js diff --git a/CHANGES.md b/CHANGES.md index 3300d4b..f5cd8a0 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,9 @@ # Changelog +## Version 4.1.04 de Deltacms +- Modifications : + - Langues : ajout de 4 langues régionales, corse, breton, catalan, basque. + ## Version 4.1.03 de Deltacms - Modifications : - Statislite : amèioration de l'affichage de la date initiale, diff --git a/README.md b/README.md index 552c39a..6874cdc 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -# DeltaCMS 4.1.03 +# DeltaCMS 4.1.04 DeltaCMS est un CMS sans base de données (flat-file) qui permet de créer et gérer facilement un site web sans aucune connaissance en programmation. L'administration du site est bilingue anglais ou français, le site peut être rédigé dans une des principales langues européennes. diff --git a/core/core.js.php b/core/core.js.php index 42aca60..6de9e7a 100644 --- a/core/core.js.php +++ b/core/core.js.php @@ -322,7 +322,14 @@ core.start = function() { }); // Confirmation de mise à jour $("#barUpdate").on("click", function() { - return core.confirm("Effectuer la mise à jour ?", function() { + var text = ""; + getData(['config', 'i18n', 'langAdmin' ]) === 'fr'){ + echo 'text = "Effectuer la mise à jour ?";' ; + } + else{ + echo 'text = "Updating ?";' ; + } ?> + return core.confirm( text, function() { $(location).attr("href", $("#barUpdate").attr("href")); }); }); diff --git a/core/include/update.inc.php b/core/include/update.inc.php index a9d0629..dad45a2 100644 --- a/core/include/update.inc.php +++ b/core/include/update.inc.php @@ -43,10 +43,14 @@ if ($this->getData(['core', 'dataVersion']) < 4101) { $this->setData(['core', 'dataVersion', 4101]); } -if ($this->getData(['core', 'dataVersion']) < 4103) { +if ($this->getData(['core', 'dataVersion']) < 4104) { + $this->setData(['config', 'i18n', 'br', 'none']); + $this->setData(['config', 'i18n', 'ca', 'none']); + $this->setData(['config', 'i18n', 'co', 'none']); + $this->setData(['config', 'i18n', 'eu', 'none']); // Mise à jour - $this->setData(['core', 'dataVersion', 4103]); + $this->setData(['core', 'dataVersion', 4104]); } diff --git a/core/module/config/config.php b/core/module/config/config.php index 0e81dd9..d6a2c07 100644 --- a/core/module/config/config.php +++ b/core/module/config/config.php @@ -616,7 +616,16 @@ class config extends common { 'es' => $this->getData(['config', 'i18n', 'es']), 'it' => $this->getData(['config', 'i18n', 'it']), 'nl' => $this->getData(['config', 'i18n', 'nl']), - 'pt' => $this->getData(['config', 'i18n', 'pt']) + 'pt' => $this->getData(['config', 'i18n', 'pt']), + 'el' => $this->getData(['config', 'i18n', 'el']), + 'da' => $this->getData(['config', 'i18n', 'da']), + 'fi' => $this->getData(['config', 'i18n', 'fi']), + 'ga' => $this->getData(['config', 'i18n', 'ga']), + 'sv' => $this->getData(['config', 'i18n', 'sv']), + 'br' => $this->getData(['config', 'i18n', 'br']), + 'ca' => $this->getData(['config', 'i18n', 'ca']), + 'co' => $this->getData(['config', 'i18n', 'co']), + 'eu' => $this->getData(['config', 'i18n', 'eu']) ] ] ]); diff --git a/core/module/install/ressource/br/accueil.html b/core/module/install/ressource/br/accueil.html new file mode 100644 index 0000000..2e6937c --- /dev/null +++ b/core/module/install/ressource/br/accueil.html @@ -0,0 +1,6 @@ +

Deltacms

+
+

Bienvenue sur votre nouveau site DeltaCMS !

+

Un email contenant le récapitulatif de votre installation vient de vous être envoyé.

 

+

Connectez-vous dès maintenant à votre espace membre afin de créer un site à votre image ! Vous pourrez personnaliser le thème, créer des pages, ajouter des utilisateurs et bien plus encore !

+
\ No newline at end of file diff --git a/core/module/install/ressource/ca/accueil.html b/core/module/install/ressource/ca/accueil.html new file mode 100644 index 0000000..6a4682b --- /dev/null +++ b/core/module/install/ressource/ca/accueil.html @@ -0,0 +1,6 @@ +

Deltacms

+
+

Benvinguts a la teva nova web DeltaCMS !

+

Se t'acaba d'enviar un correu electrònic que conté el resum de la teva instal·lació.

 

+

Connecta't ara a la teva àrea de membres per crear un lloc a la teva imatge! Podreu personalitzar el tema, crear pàgines, afegir usuaris i molt més.

+
\ No newline at end of file diff --git a/core/module/install/ressource/co/accueil.html b/core/module/install/ressource/co/accueil.html new file mode 100644 index 0000000..66aec9c --- /dev/null +++ b/core/module/install/ressource/co/accueil.html @@ -0,0 +1,6 @@ +

Deltacms

+
+

Benvenuti à u vostru novu situ DeltaCMS !

+

Un email chì cuntene u riassuntu di a vostra installazione hè statu mandatu à voi.

 

+

Cunnettete avà à a vostra zona di membri per creà un situ in a vostra imagina! Puderete persunalizà u tema, creà pagine, aghjunghje utilizatori è assai di più!

+
\ No newline at end of file diff --git a/core/module/install/ressource/database_en/base/content/blog.html b/core/module/install/ressource/database_en/base/content/blog.html index f0a3abd..3760568 100644 --- a/core/module/install/ressource/database_en/base/content/blog.html +++ b/core/module/install/ressource/database_en/base/content/blog.html @@ -1 +1 @@ -

This page contains an instance of the blog module. Click on an article to read it and post comments.

\ No newline at end of file +

This page contains a blog module. Click on an article to read it and post comments.

\ No newline at end of file diff --git a/core/module/install/ressource/database_en/base/content/galeries.html b/core/module/install/ressource/database_en/base/content/galeries.html index 04b57d7..dd40e05 100644 --- a/core/module/install/ressource/database_en/base/content/galeries.html +++ b/core/module/install/ressource/database_en/base/content/galeries.html @@ -1 +1 @@ -

This page contains an instance of the photo gallery module. Click on the gallery below to see the photos it contains.

\ No newline at end of file +

This page contains a photo gallery module. Click on the gallery below to see the photos it contains.

\ No newline at end of file diff --git a/core/module/install/ressource/defaultdata.php b/core/module/install/ressource/defaultdata.php index ac8df31..d229c8f 100644 --- a/core/module/install/ressource/defaultdata.php +++ b/core/module/install/ressource/defaultdata.php @@ -62,11 +62,15 @@ class init extends common { 'da'=> 'none', 'ga'=> 'none', 'fi'=> 'none', - 'sv'=> 'none' + 'sv'=> 'none', + 'eu'=> 'none', + 'br'=> 'none', + 'ca'=> 'none', + 'co'=> 'none' ] ], 'core' => [ - 'dataVersion' => 4103, + 'dataVersion' => 4104, 'lastBackup' => 0, 'lastClearTmp' => 0, 'lastAutoUpdate' => 0, @@ -1006,10 +1010,10 @@ class init extends common {

Pour ajouter un menu à une page, choisissez une barre latérale avec menu dans la page de configuration. Les bulles d\'aide de la rubrique "Menu" expliquent comment masquer une page.

' ], 'blog' => [ - 'content' => '

Cette page contient une instance du module de blog. Cliquez sur un article afin de le lire et de poster des commentaires.

' + 'content' => '

Cette page contient un module de blog. Cliquez sur un article afin de le lire et de poster des commentaires.

' ], 'galeries' => [ - 'content' => '

Cette page contient une instance du module de galeries photos. Cliquez sur la galerie ci-dessous afin de voir les photos qu\'elle contient.

' + 'content' => '

Cette page contient un module de galeries photos. Cliquez sur la galerie ci-dessous afin de voir les photos qu\'elle contient.

' ], 'deltacms' => [ 'content' => '' diff --git a/core/module/install/ressource/eu/accueil.html b/core/module/install/ressource/eu/accueil.html new file mode 100644 index 0000000..1ac74e3 --- /dev/null +++ b/core/module/install/ressource/eu/accueil.html @@ -0,0 +1,6 @@ +

Deltacms

+
+

Ongi etorri zure DeltaCMS gune berrira !

+

Zure instalazioaren laburpena jasotzen duen mezu elektroniko bat bidali berri dizugu.

 

+

Konektatu orain zure kideen eremura zure irudiko gune bat sortzeko! Gaia pertsonalizatu, orriak sortu, erabiltzaileak gehitu eta askoz gehiago egin ahal izango dituzu!

+
\ No newline at end of file diff --git a/core/module/translate/translate.php b/core/module/translate/translate.php index bd9ecf6..945e478 100644 --- a/core/module/translate/translate.php +++ b/core/module/translate/translate.php @@ -147,8 +147,11 @@ class translate extends common { // Soumission du formulaire if($this->isPost()) { - // Désactivation du script Google + // Si la langue originale du site choisie est seulement en traduction rédigée invalider la traduction automatique $script = $this->getInput('translateScriptGoogle', helper::FILTER_BOOLEAN); + $langBase = $this->getInput('translateLangBase'); + if( array_key_exists( $langBase, self::$i18nListSiteOnly)) $script = false; + // Désactivation du script Google if ($script === false) { setrawcookie('googtrans', '/base/base', time() + 3600, helper::baseUrl(false,false)); $_SESSION['googtrans'] = '/base/base'; @@ -166,16 +169,13 @@ class translate extends common { helper::deleteCookie('DELTA_I18N_SITE'); helper::deleteCookie('DELTA_I18N_SCRIPT'); } - - // Active le script si une langue est en trad auto - if ($script === false - AND $this->getInput('translate'. strtoupper($keyi18n)) === 'script') { - $script = true; - } } // 'langBase' mémorise le code ISO de la langue sélectionnée ou de la valeur saisie si la langue sélectionnée est Autre langue - $langBase = $this->getInput('translateLangBase'); - if( $langBase === 'none') $langBase = $this->getInput('translateOtherBase'); + $requiredOtherLang = false; + if( $langBase === 'none'){ + $langBase = $this->getInput('translateOtherBase'); + $requiredOtherLang = true; + } // Enregistrement des données $this->setData(['config','i18n', [ @@ -185,7 +185,7 @@ class translate extends common { 'autoDetect' => $this->getInput('translateScriptGoogle', helper::FILTER_BOOLEAN) ? $this->getInput('translateAutoDetect', helper::FILTER_BOOLEAN) : false, 'langAdmin' => $this->getInput('translateLangAdmin'), 'langBase' => $langBase, - 'otherLangBase' => $this->getInput('translateOtherBase'), + 'otherLangBase' => $this->getInput('translateOtherBase', helper::FILTER_STRING_SHORT,$requiredOtherLang), 'fr' => $this->getInput('translateFR'), 'de' => $this->getInput('translateDE'), 'en' => $this->getInput('translateEN'), @@ -197,7 +197,11 @@ class translate extends common { 'da' => $this->getInput('translateDA'), 'fi' => $this->getInput('translateFI'), 'ga' => $this->getInput('translateGA'), - 'sv' => $this->getInput('translateSV') + 'sv' => $this->getInput('translateSV'), + 'br' => $this->getInput('translateBR'), + 'ca' => $this->getInput('translateCA'), + 'co' => $this->getInput('translateCO'), + 'eu' => $this->getInput('translateEU') ]]); @@ -218,17 +222,30 @@ class translate extends common { if ($this->getData(['config','i18n',$key]) === 'site') { self::$translateOptions [$key] = [ 'none' => $text[1], - 'script' => $text[2], 'site' => $text[3], 'delete' => $text[4] - ]; + ]; + if( ! array_key_exists( $key, self::$i18nListSiteOnly) && $this->getData(['config','i18n','scriptGoogle'])){ + self::$translateOptions [$key] = [ + 'none' => $text[1], + 'script' => $text[2], + 'site' => $text[3], + 'delete' => $text[4] + ]; + } self::$siteTranslate = $key !== $this->getData(['config', 'i18n', 'langBase']) ? false : true; } else { self::$translateOptions [$key] = [ 'none' => $text[1], - 'script' => $text[2], 'site' => $text[3] - ]; + ]; + if( ! array_key_exists( $key, self::$i18nListSiteOnly) && $this->getData(['config','i18n','scriptGoogle'])){ + self::$translateOptions [$key] = [ + 'none' => $text[1], + 'script' => $text[2], + 'site' => $text[3] + ]; + } } // Limitation du choix pour la langue d'origine if ( $key === $this->getData(['config', 'i18n', 'langBase'])){ @@ -236,7 +253,7 @@ class translate extends common { 'none' => $text[1], 'site' => $text[5] ]; - } + } } // Valeurs en sortie $this->addOutput([ diff --git a/core/module/translate/view/index/index.js.php b/core/module/translate/view/index/index.js.php index 876be92..e6cc483 100644 --- a/core/module/translate/view/index/index.js.php +++ b/core/module/translate/view/index/index.js.php @@ -23,3 +23,13 @@ $("#translateLangBase").on("change", function() { $("#translateOtherLangBase").slideUp(); } }); + +$(function () { + // Menu fixe à afficher + if($("#translateLangBase").val() === 'none') { + $("#translateOtherLangBase").slideDown(); + } + else { + $("#translateOtherLangBase").slideUp(); + } +}); diff --git a/core/module/translate/view/index/index.php b/core/module/translate/view/index/index.php index ef48daa..1df9735 100644 --- a/core/module/translate/view/index/index.php +++ b/core/module/translate/view/index/index.php @@ -13,7 +13,7 @@ switch ($val) { $text[6] = 'Langages d\'origine et d\'administration'; $text[7] = 'Traduction automatique du site'; $text[8] = 'Active le script de traduction automatique'; - $text[9] = 'Le script Google Translate assure la traduction automatique du site.'; + $text[9] = 'Le script Google Translate assure la traduction automatique du site. Enregistrez la page pour pouvoir bénéficier des options de traduction.'; $text[10] = 'Détection automatique de la langue du navigateur'; $text[11] = 'Détecte la langue du navigateur, dans ce mode il n\'est pas nécessaire d\'afficher les drapeaux.'; $text[12] = 'Afficher les crédits du script Google'; @@ -21,6 +21,7 @@ switch ($val) { $text[14] = 'Mode de traduction du site et affichage des drapeaux'; $text[15] = 'Code ISO de l\'option Autre langue'; $text[16] = 'Saisir le code ISO de la langue constitué de 2 lettres minuscules'; + $text[17] = 'La langue originale de rédaction du site n\'est pas prise en charge par le script de traduction automatique.'; $i18nList = core::$i18nList; break; case 'en' : @@ -33,7 +34,7 @@ switch ($val) { $text[6] = 'Languages of origin and administration'; $text[7] = 'Automatic website translation'; $text[8] = 'Activate the automatic translation script'; - $text[9] = 'The Google Translate script automatically translates the site.'; + $text[9] = 'The Google Translate script automatically translates the site. Save the page to take advantage of translation options.'; $text[10] = 'Automatic detection of the browser language'; $text[11] = 'Detects the language of the browser, in this mode it is not necessary to display the flags.'; $text[12] = 'Show Google script credits'; @@ -41,6 +42,7 @@ switch ($val) { $text[14] = 'Site translation mode and flag display'; $text[15] = 'ISO code for Other language option'; $text[16] = 'Enter the ISO language code consisting of 2 lower case letters'; + $text[17] = 'The original language of the site is not supported by the machine translation script.'; $i18nList = core::$i18nList_en; break; } @@ -122,6 +124,7 @@ switch ($val) {

+ getData(['config', 'i18n' , 'langBase']), self::$i18nListSiteOnly)) { ?>
-
+ +
+ +
+ +
@@ -243,6 +251,36 @@ switch ($val) { ]); ?>
+
+
+ template::flag('br', '30px'), + 'class' => 'translateFlagSelect', + 'selected' => $this->getData(['config', 'i18n' , 'br']) + ]); ?> +
+
+ template::flag('ca', '30px'), + 'class' => 'translateFlagSelect', + 'selected' => $this->getData(['config', 'i18n' , 'ca']) + ]); ?> +
+
+ template::flag('co', '30px'), + 'class' => 'translateFlagSelect', + 'selected' => $this->getData(['config', 'i18n' , 'co']) + ]); ?> +
+
+ template::flag('eu', '30px'), + 'class' => 'translateFlagSelect', + 'selected' => $this->getData(['config', 'i18n' , 'eu']) + ]); ?> +
+
diff --git a/core/vendor/i18n/png/br.png b/core/vendor/i18n/png/br.png new file mode 100644 index 0000000000000000000000000000000000000000..a6d12916734143001b2d4bae3578e2f72150fe03 GIT binary patch literal 470 zcmV;{0V)28P)gGq5=wb~Hejx~&V9+IM64Ac#7U|e4g!Y-9+>mol-gBAzgVX6mC*xt0 W%9a-CDoVz=A-FaI z`BJGwsVrs<=;3g9d3k9vnM5KH;C{`5&*$@aJUlv`&a11dGsN$+L?S_sEQTicHyVv} z`v3RF{5;%jHa|W-knxL)i=(3> zsZeEg8|zo-#}AKWwTkiTz+tH5Dte6g#wnIo}P}6k9T%d3SgB@bFNl)9vr?L&jh*ST2{@pq$VI7k*;e4$?^^60_NiJm3*m zMk0T5x!lW38K3xVL2|N&bT*p}PJrPkI;w_DAOMU}tJVI_f)?bmxpp`l)C^4e7`0k0 zHXs|JPzY)-DMx%P|!%VyrlyI-DZ?oWLM$ zBFT>uq}-h>Km&!QXgF^IGm;{`crKM`HikI_5oo~DYauQ{C0x~04dN6?pH5`S)~Flu=!zTy4ehn)tFzrkenG*^@$7htYz#YVy}$1B zL7>2dbB>Q&R51MoyrDYVUn?_B@3S7gmuD~502WLE7V=vW5|~L1ceB)A1h=2En-;-b zX?U8g@bZ#rCSs+1V`orc!uc#qVX4&9av|73k4Mr}P*tj%(9*-(eh`G7@TN>0i=R%G zEi1XW9JU&Ibtfaq4?6RJ@ob`r}{{CQNXHeeq(PuAZ?RU`t(sdHSQ4Y(6 z@{FN0IY0mf!0q^CoD&CS0%hUEqf)Vlja-Tjf2E8nDN_<#CTTH{Rs-qIBem-8fwlk{ z6qwYBDFoOuPnRiQ@=-`cIzWPeK_Opk^?%BWt$x{ld$pnNXI;%}x9!F|=d~ec)u8Lj zVEe$zSfGqhV8VHQ$cX@iA$YZ+7Ktl6VM2)SuVZ}|=lVYfZy%v03uzfc`htY?)eq@M z9n#-bNPomzEvD!Hx0sFQ*(soZ#getData(['config', 'i18n', 'langBase']); if ( !empty($_COOKIE["DELTA_I18N_SITE"])) { if( $this->getInput('DELTA_I18N_SITE') !== 'base' ) $lang = $this->getInput('DELTA_I18N_SITE'); } -// Si une autre langue est détectée, tinymce suivra la langue d'administration -if( !isset(core::$i18nList[$lang] )) $lang = $this->getData(['config', 'i18n', 'langAdmin']); $lang_page = $lang; switch ($lang) { case 'en' : @@ -21,7 +19,17 @@ switch ($lang) { $lang_page = 'fr_FR'; break; } - +// Si la langue n'est pas supportée par Tinymce la langue d'administration est utilisée +if( ! file_exists( 'core/vendor/tinymce/langs/'.$lang_page.'.js' )){ + switch ($this->getData(['config', 'i18n', 'langAdmin'])) { + case 'en' : + $lang_page = 'en_GB'; + break; + case 'fr' : + $lang_page = 'fr_FR'; + break; + } +} echo ''; echo ''; echo '';