Check lang in install

This commit is contained in:
Frédéric K 2015-08-16 12:34:53 +02:00
parent 7227a55044
commit 2bbd0aba16
8 changed files with 25 additions and 11 deletions

22
install.php Normal file → Executable file
View File

@ -9,7 +9,7 @@
// Security constant // Security constant
define('BLUDIT', true); define('BLUDIT', true);
// Directory separator // Directory separator
define('DS', DIRECTORY_SEPARATOR); define('DS', DIRECTORY_SEPARATOR);
@ -60,6 +60,10 @@ include(PATH_HELPERS.'text.class.php');
include(PATH_ABSTRACT.'dbjson.class.php'); include(PATH_ABSTRACT.'dbjson.class.php');
include(PATH_KERNEL.'dblanguage.class.php'); include(PATH_KERNEL.'dblanguage.class.php');
// Load language
$locale = Locale::acceptFromHttp($_SERVER['HTTP_ACCEPT_LANGUAGE']);
$Language = new dbLanguage($locale);
// ============================================================================ // ============================================================================
// FUNCTIONS // FUNCTIONS
// ============================================================================ // ============================================================================
@ -351,7 +355,7 @@ if( $_SERVER['REQUEST_METHOD'] == 'POST' )
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Bludit Installer</title> <title><?php echo $Language->get('Bludit Installer') ?></title>
<link rel="stylesheet" href="./css/kube.min.css"> <link rel="stylesheet" href="./css/kube.min.css">
<link rel="stylesheet" href="./css/installer.css"> <link rel="stylesheet" href="./css/installer.css">
@ -363,8 +367,8 @@ if( $_SERVER['REQUEST_METHOD'] == 'POST' )
<div class="units-row"> <div class="units-row">
<div class="unit-centered unit-60"> <div class="unit-centered unit-60">
<div class="main"> <div class="main">
<h1 class="title">Bludit Installer</h1> <h1 class="title"><?php echo $Language->get('Bludit Installer') ?></h1>
<p>Welcome to the Bludit installer</p> <p><?php echo $Language->get('Welcome to the Bludit installer') ?></p>
<?php <?php
$system = checkSystem(); $system = checkSystem();
@ -373,7 +377,7 @@ if( $_SERVER['REQUEST_METHOD'] == 'POST' )
{ {
?> ?>
<p>Complete the form, choose a password for the username <strong>admin</strong></p> <p><?php echo $Language->get('Complete the form, choose a password for the username « admin »') ?></p>
<div class="unit-centered unit-40"> <div class="unit-centered unit-40">
@ -392,15 +396,15 @@ if( $_SERVER['REQUEST_METHOD'] == 'POST' )
</label> </label>
<label> <label>
<input type="text" name="password" id="jspassword" placeholder="Password, visible field!" class="width-100" autocomplete="off" maxlength="100" value="<?php echo isset($_POST['password'])?$_POST['password']:'' ?>"> <input type="text" name="password" id="jspassword" placeholder="<?php echo $Language->get('Password, visible field!') ?>" class="width-100" autocomplete="off" maxlength="100" value="<?php echo isset($_POST['password'])?$_POST['password']:'' ?>">
</label> </label>
<label> <label>
<input type="text" name="email" id="jsemail" placeholder="Email" class="width-100" autocomplete="off" maxlength="100"> <input type="text" name="email" id="jsemail" placeholder="<?php echo $Language->get('Email') ?>" class="width-100" autocomplete="off" maxlength="100">
</label> </label>
<label for="jslanguage"> <label for="jslanguage">
<select id="jslanguage" name="language" class="width-100"> <select id="jslanguage" name="language" class="width-100" onchange="this.form.submit()">
<?php <?php
$htmlOptions = getLanguageList(); $htmlOptions = getLanguageList();
foreach($htmlOptions as $locale=>$nativeName) { foreach($htmlOptions as $locale=>$nativeName) {
@ -411,7 +415,7 @@ if( $_SERVER['REQUEST_METHOD'] == 'POST' )
</label> </label>
<p> <p>
<button class="btn btn-blue width-100">Install</button> <button class="btn btn-blue width-100"><?php echo $Language->get('Install') ?></button>
</p> </p>
</form> </form>
</div> </div>

7
languages/en_US.json Normal file → Executable file
View File

@ -8,7 +8,12 @@
"email": "", "email": "",
"website": "" "website": ""
}, },
"bludit-installer": "Bludit Installer",
"welcome-to-the-bludit-installer": "Welcome to the Bludit installer",
"complete-the-form,-choose-a-password-for-the-username-«-admin-»": "Complete the form, choose a password for the username « admin »",
"password,-visible-field!": "Password, visible field!",
"install": "Install",
"username": "Username", "username": "Username",
"password": "Password", "password": "Password",
"confirm-password": "Confirm Password", "confirm-password": "Confirm Password",

0
languages/es_AR.json Normal file → Executable file
View File

0
languages/es_VE.json Normal file → Executable file
View File

View File

@ -8,7 +8,12 @@
"email": "", "email": "",
"website": "" "website": ""
}, },
"bludit-installer": "Installation de Bludit",
"welcome-to-the-bludit-installer": "Bienvenue dans lassistant dinstallation de Bludit",
"complete-the-form,-choose-a-password-for-the-username-«-admin-»": "Complétez le formulaire et choisissez un mot de passe pour lutilisateur « admin »",
"password,-visible-field!": "Mot de passe, champ visible !",
"install": "Installer",
"username": "Nom dutilisateur", "username": "Nom dutilisateur",
"password": "Mot de passe", "password": "Mot de passe",
"confirm-password": "Confirmation du mot de passe", "confirm-password": "Confirmation du mot de passe",

0
languages/ja_JP.json Normal file → Executable file
View File

0
languages/ru_RU.json Normal file → Executable file
View File

0
languages/zh_TW.json Normal file → Executable file
View File