]> _ Git - cubedesigners-v7.git/commitdiff
Improve localization
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 4 Jun 2015 14:21:14 +0000 (14:21 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 4 Jun 2015 14:21:14 +0000 (14:21 +0000)
Import english contents

.htaccess
framework/application/Bootstrap.php
framework/application/configs/application.ini
framework/application/controllers/MaintenanceController.php
framework/application/views/scripts/common/footer.phtml
less/footer.less

index 3e732072e22dfed8fec22e529f5c3b752877b1f0..5b4cd42bc3ce229070208d7647a9324b5422f378 100644 (file)
--- a/.htaccess
+++ b/.htaccess
@@ -19,9 +19,8 @@
        RewriteCond %{HTTP_HOST} =cubedesigners.fr
        RewriteRule ^(.*)$ http://www.cubedesigners.fr/$1 [R=301,L]
        # Redirection to www. subdomain
-       RewriteCond %{HTTP_HOST} =cubedesigners.com [OR]
-       RewriteCond %{HTTP_HOST} =www.cubedesigners.com
-       RewriteRule ^(.*)$ http://www.cubedesigners.fr/$1 [R=301,L]
+       RewriteCond %{HTTP_HOST} =cubedesigners.com
+       RewriteRule ^(.*)$ http://www.cubedesigners.com/$1 [R=301,L]
 
     # Block browser access to the framework folder and sensitive files
     RewriteRule ^framework/.*$ - [F]
index 854d1e116d63fcd4f53373deee5166dd534578c9..1eaa6c4f762edfb67187d804edde6416921581e7 100644 (file)
@@ -11,7 +11,7 @@ class Bootstrap extends CubeIT_Bootstrap {
 
        protected function _initRouter($initCms = true) {
                $router = parent::_initRouter($initCms);
-        $router->addStandardRoute('rss');
+               $router->addStandardRoute('rss');
                return $router;
        }
 
@@ -45,7 +45,7 @@ class Bootstrap extends CubeIT_Bootstrap {
                $datas = $this->getCMSDatasOfNavigationPage($page);
                $db = Zend_Db_Table::getDefaultAdapter();
                $s = $db->select()->from('realisations')
-                               ->order('id ASC');
+                       ->order('id ASC');
                $q = $s->query();
 
                while ($r = $q->fetch()) {
@@ -80,7 +80,7 @@ class Bootstrap extends CubeIT_Bootstrap {
                $datas = $this->getCMSDatasOfNavigationPage($page);
                $db = Zend_Db_Table::getDefaultAdapter();
                $s = $db->select()->from('casestudies')
-                               ->order('id ASC');
+                       ->order('id ASC');
                $q = $s->query();
 
                while ($r = $q->fetch()) {
@@ -120,7 +120,7 @@ class Bootstrap extends CubeIT_Bootstrap {
                $templates['realisations'] = 'Réalisations';
                $templates['Etudes de cas'] = array('casestudies' => 'Accueil des études de cas', 'casestudies_detail' => 'Détail d\'étude de cas');
                $templates['Expertises'] = array('expertises' => 'Accueil de la rubrique Expertises',
-                       'expertise' => 'Page de détail d\'expertise');
+                                                'expertise' => 'Page de détail d\'expertise');
                $templates['contact'] = 'Contact';
 
                return $templates;
@@ -142,35 +142,32 @@ class Bootstrap extends CubeIT_Bootstrap {
                $locale = array_shift($e);
 
                $res = '/';
-               if ($locale == 'en') {
-                       return 'http://en.cubedesigners.com/en/' . $path;
-               }
 
                if ($locale == 'references_web') {
-                       $res.='Portfolio';
+                       $res .= 'Portfolio';
                        return $res;
                }
 
-               if ($locale != 'fr') {
+               if ($locale != 'fr' && $locale != 'en') {
                        return false;
                }
 
                if (count($e) == 1) {
                        $u = $e[0];
                        if ($u == '1-Sites-internet') {
-                               $res.='Projets-Web';
+                               $res .= 'Projets-Web';
                        } elseif ($u == '2-Design-graphique') {
-                               $res.='Graphisme';
+                               $res .= 'Graphisme';
                        } elseif ($u == '3-Design-industriel') {
-                               $res.='Design-industriel';
+                               $res .= 'Design-industriel';
                        } elseif ($u == '4-Multimedia-Jeux') {
-                               $res.='Multimedia';
+                               $res .= 'Multimedia';
                        } elseif ($u == '5-Films-Animation') {
-                               $res.='Multimedia';
+                               $res .= 'Multimedia';
                        } elseif ($u == '6-Applications-mobiles') {
-                               $res.='Projets-Web';
+                               $res .= 'Projets-Web';
                        } elseif ($u == '7-En-attente') {
-                               $res.='Graphisme';
+                               $res .= 'Graphisme';
                        }
                        return $res;
                }
@@ -186,7 +183,7 @@ class Bootstrap extends CubeIT_Bootstrap {
                        /// Mobile-applications/Heredis/114-Heredis-App => Applications-mobiles/Heredis-Heredis-App
                        $ee = explode('-', $e[2], 2);
                        array_shift($ee);
-                       $res.=$e[0] . '/' . $e[1] . '-' . implode('-', $ee);
+                       $res .= $e[0] . '/' . $e[1] . '-' . implode('-', $ee);
                        return $res;
                }
 
index 2ef479fbfcdb6c49a9fa5028ca5896a75af1801d..442e8c48e2e152420d7a7b6db2e6e40df20b8dde 100644 (file)
@@ -1,5 +1,5 @@
 [production]
-dev = false
+dev = true
 firephp = true
 
 minify.js = true
index 9b0fadf2cfe434f894701abf6805dda8c4eaf179..810ceac5813920dc0bc602ba18ef976be26b37c0 100644 (file)
@@ -2,67 +2,8 @@
 
 class MaintenanceController extends CubeIT_Controller_MaintenanceController {
 
-       public function import() {
-               return;
-               $this->getDb()->truncate('realisations');
-               $former = Bootstrap::getInstance()->getOpt('former.home') . '/files/';
-
-               $clients = $this->getFormerDb()
-                                               ->select()->from('clients')
-                                               ->where('valid = 1')
-                                               ->query()->fetchAll();
-
-               $realisations = $this->getFormerDb()
-                                               ->select()->from('project')
-                                               ->where('valid = ?', 1)
-                                               ->order('id ASC')
-                                               ->query()->fetchAll();
-
-               $categories = array(1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 6, 6 => 7);
-
-               foreach ($realisations as $r) {
-                       $n = new Cubedesigners_Model_Realisation();
-
-                       $e = explode('.', $r->client_id);
-                       $n->setId($r->id);
-                       $n->setTitre(html_entity_decode($clients[$e[1]]->title));
-                       $n->setLegende(array('fr' => html_entity_decode($r->title_fr), 'en' => html_entity_decode($r->title_en)));
-                       $n->setAgence($r->agence);
-                       $n->setUrl(
-                                       array(
-                                               'fr' => array('label' => html_entity_decode($r->link_txt_fr), 'url' => html_entity_decode($r->link_fr)),
-                                               'en' => array('label' => html_entity_decode($r->link_txt_en), 'url' => html_entity_decode($r->link_en))
-                                       )
-                       );
-                       $n->setDescription(array('fr' => html_entity_decode($r->desc_fr), 'en' => html_entity_decode($r->desc_en)));
-                       $n->setVisuel(array($this->_copyFileToCMS($former . $r->icon_file)));
-                       $files = explode('$', $r->pres_files);
-                       $local = array();
-                       foreach ($files as $f) {
-                               $local[] = $this->_copyFileToCMS($former . $f);
-                       }
-                       $n->setVisuelDetail($local);
-                       $c = explode('.', $r->category_id);
-                       $n->setCategories($categories[$c[1]]);
-                       $n->setDate(new Zend_Date($r->date, Zend_Date::TIMESTAMP));
-                       $n->setOnline($r->visible);
-                       $n->save(true);
-               }
+       public function importEn() {
+               $import = new CubeIT_Translate_Import_Excel('fr', 'en');
+               $import->import(PUBLIC_PATH . '/translations_en.xlsx');
        }
-
-       public function categories() {
-               $models = array('Categorie', 'Domaine', 'Technologie', 'Tag');
-               foreach ($models as $m) {
-                       $factory = call_user_func(array('Cubedesigners_Model_' . $m, 'factory'));
-
-                       foreach ($factory->find() as $c) {
-                               if (CubeIT_Util_Json::isJson($c->getName())) {
-                                       continue;
-                               }
-                               $c->setName(array('fr' => $c->getName(), 'en' => ''));
-                               $c->save();
-                       }
-               }
-       }
-
 }
index f9679d400b6ddbb36dd35099d26b2c7e3052485e..dc80e82371af56f2100e267bf1dd9386ea55e904 100644 (file)
@@ -39,8 +39,10 @@ echo $this->clear();
                                        }
                                        ?>
                                </div>
-                               <nav  class="locales">
-                                       <?php
+
+                               <?php
+                               if (!in_array('en', $this->localesEnabled())) {
+                                       echo '<nav class="locale">';
                                        $fr = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
                                        if (!isset($this->enversion)) {
                                                $en = 'http://en.cubedesigners.com/en/';
@@ -49,7 +51,11 @@ echo $this->clear();
                                        }
                                        echo $this->link('fr', $fr, array('class' => 'active', 'hreflang' => 'fr'));
                                        echo $this->link('en', $en, array('hreflang' => 'en'));
-                                       ?>
+                                       echo '</nav>';
+                               } else {
+                                       echo $this->localeNavigation(true, CubeIT_View_Helper_LocaleNavigation::BIGRAMME);
+                               }
+                               ?>
                                </nav>
                        </div>
                </div>
index 95cb7784244ad66577ee82122390c3cff3aa7b19..aaa1b9edf67f0503cc4a1c2e80865e3926b32f5d 100644 (file)
 #footer {
        .footer-top {
-               padding:50px 0 0 0;
+               padding: 50px 0 0 0;
                background-color: #282828;
                .footer-top-content {
-//                     max-width:980px;
-//                     margin: 0 auto;
+                       //                      max-width:980px;
+                       //                      margin: 0 auto;
                        overflow: hidden;
-                       padding-bottom:50px;
-                       white-space:nowrap;
+                       padding-bottom: 50px;
+                       white-space: nowrap;
                        .bloc {
-//                             display: inline-block;
-                float: left;
+                               //                              display: inline-block;
+                               float: left;
                                white-space: normal;
-                               vertical-align:top;
+                               vertical-align: top;
                                width: 50%;
-                               padding:0 20px 0 0;
-
-                &:last-child {
-                  padding-right: 0;
-                  padding-left: 20px;
-                }
-
-                @media screen and (max-width: 1000px) {
-                  width: 100%;
-                  padding: 0 0 40px 0;
-
-                  &:last-child {
-                    padding: 0;
-                  }
-                }
-
-              h2 {
-                  color:#fff;
-                  font-size:56px;
-                  line-height: 45px;
-                  padding-bottom: 50px;
-
-                  @media screen and (max-width: 1000px) {
-                    padding-bottom: 30px;
-                  }
-                }
-
-              .social{
-                  h2{
-                      padding:0 0 25px 0;
-                    }
-                }
-
-              .actus{
-                  padding-bottom: 40px;
-
-                @media screen and (min-width: 980px) {
-                  min-height: 356px;
-                }
-
-                  .actu {
-                      color:#6c6c6c;
-                      padding-bottom: 20px;
-
-                      &:last-child {
-                        padding-bottom: 0;
-                      }
-
-                      a{
-                          color:#6c6c6c;
-                        }
-
-                      h3 {
-                          width: 90%;
-                          font-size: 16px;
-                          line-height: 20px;
-                        }
-
-                      .date {
-                          font-size: 12px;
-                      }
-                  }
-              }
+                               padding: 0 20px 0 0;
+
+                               &:last-child {
+                                       padding-right: 0;
+                                       padding-left: 20px;
+                               }
+
+                               @media screen and (max-width: 1000px) {
+                                       width: 100%;
+                                       padding: 0 0 40px 0;
+
+                                       &:last-child {
+                                               padding: 0;
+                                       }
+                               }
+
+                               h2 {
+                                       color: #fff;
+                                       font-size: 56px;
+                                       line-height: 45px;
+                                       padding-bottom: 50px;
+
+                                       @media screen and (max-width: 1000px) {
+                                               padding-bottom: 30px;
+                                       }
+                               }
+
+                               .social {
+                                       h2 {
+                                               padding: 0 0 25px 0;
+                                       }
+                               }
+
+                               .actus {
+                                       padding-bottom: 40px;
+
+                                       @media screen and (min-width: 980px) {
+                                               min-height: 356px;
+                                       }
+
+                                       .actu {
+                                               color: #6c6c6c;
+                                               padding-bottom: 20px;
+
+                                               &:last-child {
+                                                       padding-bottom: 0;
+                                               }
+
+                                               a {
+                                                       color: #6c6c6c;
+                                               }
+
+                                               h3 {
+                                                       width: 90%;
+                                                       font-size: 16px;
+                                                       line-height: 20px;
+                                               }
+
+                                               .date {
+                                                       font-size: 12px;
+                                               }
+                                       }
+                               }
                        }
                }
        }
 
        .contact-texte {
                background-image: url('../images/picto_footer_mail.svg');
-               background-repeat:  no-repeat;
-               background-position:0px 10px;
-               color:#fff;
-               padding-left:70px;
+               background-repeat: no-repeat;
+               background-position: 0px 10px;
+               color: #fff;
+               padding-left: 70px;
                padding-bottom: 50px;
        }
        .bureau {
                //display:inline-block;
-        float: left;
+               float: left;
                width: 50%;
                vertical-align: top;
-               color:#6c6c6c;
+               color: #6c6c6c;
                padding-right: 21px;
 
-        &:last-child{
+               &:last-child {
                        padding-right: 0;
-            padding-left: 21px;
+                       padding-left: 21px;
                }
 
-        @media screen and (max-width: 1000px) {
-          width: auto;
-          float: none;
-          display: inline-block;
-          padding: 0 0 20px 0;
-          margin-right: 40px;
+               @media screen and (max-width: 1000px) {
+                       width: auto;
+                       float: none;
+                       display: inline-block;
+                       padding: 0 0 20px 0;
+                       margin-right: 40px;
 
-          &:last-child {
-            padding: 0;
-            margin: 0;
-          }
-        }
+                       &:last-child {
+                               padding: 0;
+                               margin: 0;
+                       }
+               }
 
-               .titre,.numeros {
+               .titre, .numeros {
                        padding-bottom: 20px;
                }
 
                .numeros a {
-                       color:#6c6c6c;
+                       color: #6c6c6c;
                }
                .geoloc {
-                       padding-top : 30px;
+                       padding-top: 30px;
                        a.but {
                                background-color: #191919;
-                               color:#6c6c6c;
-                               margin:0;
+                               color: #6c6c6c;
+                               margin: 0;
                        }
                }
        }
 
-
        .reseaux {
                .social {
-                       display:inline-block;
+                       display: inline-block;
                        width: 42px;
                        height: 42px;
                        box-sizing: border-box;
                        margin-right: 20px;
                        background-color: #191919;
                        border-radius: 25px;
-                       padding:8px 0 0 0;
+                       padding: 8px 0 0 0;
                }
 
-               .Pinterest{
-                       display:none;
+               .Pinterest {
+                       display: none;
                }
 
                .Facebook:hover {
                font-size: 12px;
                line-height: 46px;
 
-               .copyright{
-                       display:inline-block;
-                       float:left;
+               .copyright {
+                       display: inline-block;
+                       float: left;
                }
 
-               .locales{
-                       float:right;
-                       a{
-                               display:inline-block;
+               .locale {
+                       float: right;
+                       a {
+                               display: inline-block;
                                line-height: 30px;
                                text-transform: uppercase;
-                               height:30px;
-                               width:30px;
+                               height: 30px;
+                               width: 30px;
                                border-radius: 30px;
-                               background-color:#282828;
-                               color:#616161;
-                               text-align:center;
-                               margin:0 0 0 10px;
-
-                               &.active,&:hover{
-                                       background-color:#3885e0;
-                                       color:#fff;
+                               background-color: #282828;
+                               color: #616161;
+                               text-align: center;
+                               margin: 0 0 0 10px;
+
+                               &.active, &:hover {
+                                       background-color: #3885e0;
+                                       color: #fff;
                                }
                        }
                }