From: vincent@cubedesigners.com Date: Thu, 4 Jun 2015 14:21:14 +0000 (+0000) Subject: Improve localization X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=893f6d27e6be49eeac61d6e88f6c693191828d9f;p=cubedesigners-v7.git Improve localization Import english contents --- diff --git a/.htaccess b/.htaccess index 3e73207..5b4cd42 100644 --- 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] diff --git a/framework/application/Bootstrap.php b/framework/application/Bootstrap.php index 854d1e1..1eaa6c4 100644 --- a/framework/application/Bootstrap.php +++ b/framework/application/Bootstrap.php @@ -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; } diff --git a/framework/application/configs/application.ini b/framework/application/configs/application.ini index 2ef479f..442e8c4 100644 --- a/framework/application/configs/application.ini +++ b/framework/application/configs/application.ini @@ -1,5 +1,5 @@ [production] -dev = false +dev = true firephp = true minify.js = true diff --git a/framework/application/controllers/MaintenanceController.php b/framework/application/controllers/MaintenanceController.php index 9b0fadf..810ceac 100644 --- a/framework/application/controllers/MaintenanceController.php +++ b/framework/application/controllers/MaintenanceController.php @@ -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(); - } - } - } - } diff --git a/framework/application/views/scripts/common/footer.phtml b/framework/application/views/scripts/common/footer.phtml index f9679d4..dc80e82 100644 --- a/framework/application/views/scripts/common/footer.phtml +++ b/framework/application/views/scripts/common/footer.phtml @@ -39,8 +39,10 @@ echo $this->clear(); } ?> - diff --git a/less/footer.less b/less/footer.less index 95cb778..aaa1b9e 100644 --- a/less/footer.less +++ b/less/footer.less @@ -1,141 +1,140 @@ #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; @@ -143,11 +142,11 @@ 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 { @@ -171,28 +170,28 @@ 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; } } }