Implementation of the translation system for installation process

This commit is contained in:
Nicolas Villa
2014-01-20 07:55:24 +01:00
parent b7fc2fc0e5
commit 9056c725c7
9 changed files with 126 additions and 36 deletions

View File

@@ -22,6 +22,21 @@
/*************************************************************************************/
session_start();
include 'bootstrap.php';
use Symfony\Component\Translation\Translator;
$_SESSION['install']['lang'] = "en_US";
if($_REQUEST['lang']){
$_SESSION['install']['lang'] = $_REQUEST['lang'];
}
$trans = new Translator();
$trans->setLocale($_SESSION['install']['lang']);
$trans->addLoader("php", new Symfony\Component\Translation\Loader\PhpFileLoader());
$trans->addResource('php', __DIR__.'/I18n/'.$_SESSION['install']['lang'].'.php', $_SESSION['install']['lang']);
?>
<!DOCTYPE html>
<html lang="">
@@ -29,14 +44,16 @@ include 'bootstrap.php';
<title>Installation</title>
<link rel="shortcut icon" href="fd33fd0-6fda040.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="UTF-8">
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div class="topbar">
<div class="container">
<div class="row">
<div class="col-md-6">
<div class="version-info">Version undefined</div>
<div class="version-info"><?php echo $trans->trans('Version undefined'); ?></div>
</div>
</div>
</div>
@@ -46,14 +63,14 @@ include 'bootstrap.php';
<div class="row">
<div class="col-md-12">
<div class="general-block-decorator">
<h3 class="title title-without-tabs">Thelia installation wizard</h3>
<h3 class="title title-without-tabs"><?php echo $trans->trans('Thelia installation wizard'); ?></h3>
<div class="wizard">
<ul>
<li class="<?php if($step == 1){ echo 'active'; } elseif ($step > 1) { echo 'complete'; }?>"><span class="badge">1</span>Welcome<span class="chevron"></span></li>
<li class="<?php if($step == 2){ echo 'active'; } elseif ($step > 2) { echo 'complete'; }?>"><span class="badge">2</span>Checking permissions<span class="chevron"></span></li>
<li class="<?php if($step == 3){ echo 'active'; } elseif ($step > 3) { echo 'complete'; }?>"><span class="badge">3</span>Database connection<span class="chevron"></span></li>
<li class="<?php if($step == 4){ echo 'active'; } elseif ($step > 4) { echo 'complete'; }?>"><span class="badge">4</span>Database selection<span class="chevron"></span></li>
<li class="<?php if($step == 5){ echo 'active'; } elseif ($step > 5) { echo 'complete'; }?>"><span class="badge">5</span>General information<span class="chevron"></span></li>
<li class="<?php if($step == 6){ echo 'active'; } elseif ($step > 6) { echo 'complete'; }?>"><span class="badge">6</span>Thanks<span class="chevron"></span></li>
<li class="<?php if($step == 1){ echo 'active'; } elseif ($step > 1) { echo 'complete'; }?>"><span class="badge">1</span><?php echo $trans->trans('Welcome'); ?><span class="chevron"></span></li>
<li class="<?php if($step == 2){ echo 'active'; } elseif ($step > 2) { echo 'complete'; }?>"><span class="badge">2</span><?php echo $trans->trans('Checking permissions'); ?><span class="chevron"></span></li>
<li class="<?php if($step == 3){ echo 'active'; } elseif ($step > 3) { echo 'complete'; }?>"><span class="badge">3</span><?php echo $trans->trans('Database connection'); ?><span class="chevron"></span></li>
<li class="<?php if($step == 4){ echo 'active'; } elseif ($step > 4) { echo 'complete'; }?>"><span class="badge">4</span><?php echo $trans->trans('Database selection'); ?><span class="chevron"></span></li>
<li class="<?php if($step == 5){ echo 'active'; } elseif ($step > 5) { echo 'complete'; }?>"><span class="badge">5</span><?php echo $trans->trans('General information'); ?><span class="chevron"></span></li>
<li class="<?php if($step == 6){ echo 'active'; } elseif ($step > 6) { echo 'complete'; }?>"><span class="badge">6</span><?php echo $trans->trans('Thanks'); ?><span class="chevron"></span></li>
</ul>
</div>
</div>