From 9056c725c7e8a410204ab48165eb1b288e91c430 Mon Sep 17 00:00:00 2001 From: Nicolas Villa Date: Mon, 20 Jan 2014 07:55:24 +0100 Subject: [PATCH] Implementation of the translation system for installation process --- web/install/I18n/en_US.php | 34 ++++++++++++++++++++++++++++++++++ web/install/I18n/fr_FR.php | 34 ++++++++++++++++++++++++++++++++++ web/install/bdd.php | 12 ++++++------ web/install/config.php | 14 +++++++------- web/install/connection.php | 12 ++++++------ web/install/end.php | 6 +++--- web/install/header.php | 35 ++++++++++++++++++++++++++--------- web/install/index.php | 11 ++++++++--- web/install/permission.php | 4 ++-- 9 files changed, 126 insertions(+), 36 deletions(-) create mode 100644 web/install/I18n/en_US.php create mode 100755 web/install/I18n/fr_FR.php diff --git a/web/install/I18n/en_US.php b/web/install/I18n/en_US.php new file mode 100644 index 000000000..d775686a7 --- /dev/null +++ b/web/install/I18n/en_US.php @@ -0,0 +1,34 @@ + 'Administrator login :', +'Administrator password :' => 'Administrator password :', +'Administrator password verification :' => 'Administrator password verification :', +'Checking permissions' => 'Checking permissions', +'Choose your database' => 'Choose your database', +'Company name :' => 'Company name :', +'Contact email :' => 'Contact email :', +'Continue' => 'Continue', +'Create an other database' => 'Create an other database', +'Database connection' => 'Database connection', +'Database selection' => 'Database selection', +'Don\'t forget to delete the web/install directory.' => 'Don\'t forget to delete the web/install directory.', +'General information' => 'General information', +'Go to back office' => 'Go to back office', +'Host :' => 'Host :', +'or' => 'or', +'Password :' => 'Password :', +'Port :' => 'Port :', +'Select below the one you want to use.' => 'Select below the one you want to use.', +'Thanks' => 'Thanks', +'Thanks, you have installed Thelia' => 'Thanks, you have installed Thelia', +'Thelia installation wizard' => 'Thelia installation wizard', +'The SQL server contains multiple databases.' => 'The SQL server contains multiple databases.', +'Username :' => 'Username :', +'Version undefined' => 'Version undefined', +'website url :' => 'website url :', +'Welcome' => 'Welcome', +'Welcome in the Thelia installation wizard.' => 'Welcome in the Thelia installation wizard.', +'We will guide you throughout this process to install any application on your system.' => 'We will guide you throughout this process to install any application on your system.', +'Wrong connection information' => 'Wrong connection information' +); diff --git a/web/install/I18n/fr_FR.php b/web/install/I18n/fr_FR.php new file mode 100755 index 000000000..d9aee3ceb --- /dev/null +++ b/web/install/I18n/fr_FR.php @@ -0,0 +1,34 @@ + 'Identifiant administrateur :', +'Administrator password :' => 'Mot de passe administrateur :', +'Administrator password verification :' => 'Vérification mot de passe administrateur :', +'Checking permissions' => 'Permissions', +'Choose your database' => 'Choissisez la base de donnée', +'Company name :' => 'Nom de la société :', +'Contact email :' => 'Email de contact :', +'Continue' => 'Continuez', +'Create an other database' => 'Créez une nouvelle base de donnée', +'Database connection' => 'Base de donnée', +'Database selection' => 'Sélectionnez la base de donnée', +'Don\'t forget to delete the web/install directory.' => 'N\'oubliez d\'enlever le répertoire web/install.', +'General information' => 'Information générale', +'Go to back office' => 'Allez dans l\'interface d\'administration', +'Host :' => 'Hôte :', +'or' => 'ou', +'Password :' => 'Mot de passe :', +'Port :' => 'Port :', +'Select below the one you want to use.' => 'Sélectionnez ci-dessous celle que vous souhaitez utiliser.', +'Thanks' => 'Merci', +'Thanks, you have installed Thelia' => 'Merci, d\'avoir installé Thélia', +'Thelia installation wizard' => 'Gestionnaire d\'installation de Thélia', +'The SQL server contains multiple databases.' => 'Le serveur SQL contient plusieurs databases.', +'Username :' => 'Utilisateur :', +'Version undefined' => 'Version non définie', +'website url :' => 'Url du site :', +'Welcome' => 'Bienvenue', +'Welcome in the Thelia installation wizard.' => 'Bienvenue dans le gestionnaire d\'installation de Thélia.', +'We will guide you throughout this process to install any application on your system.' => 'Nous allons vous guidez pour installer Thélia sur votre système.', +'Wrong connection information' => 'Mauvaise information de connexion' +); diff --git a/web/install/bdd.php b/web/install/bdd.php index 05fcfe762..5e46fe440 100755 --- a/web/install/bdd.php +++ b/web/install/bdd.php @@ -53,10 +53,10 @@ $databases = $connection->query('show databases');
- Choose your database + trans('Choose your database'); ?>

- The SQL server contains multiple databases.
- Select below the one you want to use. + trans('The SQL server contains multiple databases.'); ?>
+ trans('Select below the one you want to use.'); ?>

@@ -93,12 +93,12 @@ $databases = $connection->query('show databases'); if($permissions->fetchColumn(0) > 0) { ?>

- or + trans('or'); ?>

@@ -109,7 +109,7 @@ $databases = $connection->query('show databases');
- +
diff --git a/web/install/config.php b/web/install/config.php index b904a7900..938befb9d 100755 --- a/web/install/config.php +++ b/web/install/config.php @@ -81,32 +81,32 @@ $website_url = preg_replace("#/install/[a-z](.*)#" ,'', $url);
- +
- +
- +
- +
- +
- +
- +
diff --git a/web/install/connection.php b/web/install/connection.php index fdbddfafd..3d017884e 100755 --- a/web/install/connection.php +++ b/web/install/connection.php @@ -32,25 +32,25 @@ $_SESSION['install']['step'] = 3; -
Wrong connection information
+
trans('Wrong connection information'); ?>
- +
- +
- +
- +
@@ -58,7 +58,7 @@ $_SESSION['install']['step'] = 3;
- +
diff --git a/web/install/end.php b/web/install/end.php index 8c1d1d55c..d3eee16f4 100755 --- a/web/install/end.php +++ b/web/install/end.php @@ -67,14 +67,14 @@ $website_url = preg_replace("#/install/[a-z](.*)#" ,'', $url);

- Thanks, you have installed Thelia + trans('Thanks, you have installed Thelia'); ?>

- Don't forget to delete the web/install directory. + trans('Don\'t forget to delete the web/install directory.'); ?>

- Go to back office + trans('Go to back office'); ?>

diff --git a/web/install/header.php b/web/install/header.php index 983fa51ce..36aa4a28d 100755 --- a/web/install/header.php +++ b/web/install/header.php @@ -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']); + + ?> @@ -29,14 +44,16 @@ include 'bootstrap.php'; Installation + +
-
Version undefined
+
trans('Version undefined'); ?>
@@ -46,14 +63,14 @@ include 'bootstrap.php';
-

Thelia installation wizard

+

trans('Thelia installation wizard'); ?>

    -
  • 1Welcome
  • -
  • 2Checking permissions
  • -
  • 3Database connection
  • -
  • 4Database selection
  • -
  • 5General information
  • -
  • 6Thanks
  • +
  • 1trans('Welcome'); ?>
  • +
  • 2trans('Checking permissions'); ?>
  • +
  • 3trans('Database connection'); ?>
  • +
  • 4trans('Database selection'); ?>
  • +
  • 5trans('General information'); ?>
  • +
  • 6trans('Thanks'); ?>
-
\ No newline at end of file +
diff --git a/web/install/index.php b/web/install/index.php index 884ca11b7..05d916e3c 100755 --- a/web/install/index.php +++ b/web/install/index.php @@ -26,14 +26,19 @@ include("header.php"); ?>
+ +

-Welcome in the Thelia installation wizard. +trans('Welcome in the Thelia installation wizard.'); ?>

-We will guide you throughout this process to install any application on your system. +trans('We will guide you throughout this process to install any application on your system.'); ?>

\ No newline at end of file diff --git a/web/install/permission.php b/web/install/permission.php index fca995457..fda432d4f 100755 --- a/web/install/permission.php +++ b/web/install/permission.php @@ -35,7 +35,7 @@ $_SESSION['install']['current_step'] = 'permission.php'; $_SESSION['install']['step'] = 2; ?>
-

Checking permissions

+

trans('Checking permissions'); ?>

    $data): ?>
  • @@ -48,7 +48,7 @@ $_SESSION['install']['step'] = 2;