From 2bbd0aba165bb874a599ee7c34fccaddf0838ac3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20K?= Date: Sun, 16 Aug 2015 12:34:53 +0200 Subject: [PATCH 1/2] Check lang in install --- install.php | 22 +++++++++++++--------- languages/en_US.json | 7 ++++++- languages/es_AR.json | 0 languages/es_VE.json | 0 languages/fr_FR.json | 7 ++++++- languages/ja_JP.json | 0 languages/ru_RU.json | 0 languages/zh_TW.json | 0 8 files changed, 25 insertions(+), 11 deletions(-) mode change 100644 => 100755 install.php mode change 100644 => 100755 languages/en_US.json mode change 100644 => 100755 languages/es_AR.json mode change 100644 => 100755 languages/es_VE.json mode change 100644 => 100755 languages/ja_JP.json mode change 100644 => 100755 languages/ru_RU.json mode change 100644 => 100755 languages/zh_TW.json diff --git a/install.php b/install.php old mode 100644 new mode 100755 index d278b097..e70cf8ae --- a/install.php +++ b/install.php @@ -9,7 +9,7 @@ // Security constant define('BLUDIT', true); - + // Directory separator define('DS', DIRECTORY_SEPARATOR); @@ -60,6 +60,10 @@ include(PATH_HELPERS.'text.class.php'); include(PATH_ABSTRACT.'dbjson.class.php'); include(PATH_KERNEL.'dblanguage.class.php'); +// Load language +$locale = Locale::acceptFromHttp($_SERVER['HTTP_ACCEPT_LANGUAGE']); +$Language = new dbLanguage($locale); + // ============================================================================ // FUNCTIONS // ============================================================================ @@ -351,7 +355,7 @@ if( $_SERVER['REQUEST_METHOD'] == 'POST' ) - Bludit Installer + <?php echo $Language->get('Bludit Installer') ?> @@ -363,8 +367,8 @@ if( $_SERVER['REQUEST_METHOD'] == 'POST' )
-

Bludit Installer

-

Welcome to the Bludit installer

+

get('Bludit Installer') ?>

+

get('Welcome to the Bludit installer') ?>

-

Complete the form, choose a password for the username admin

+

get('Complete the form, choose a password for the username « admin »') ?>

@@ -392,15 +396,15 @@ if( $_SERVER['REQUEST_METHOD'] == 'POST' )

- +

diff --git a/languages/en_US.json b/languages/en_US.json old mode 100644 new mode 100755 index 4fb8fe50..2e7e3dad --- a/languages/en_US.json +++ b/languages/en_US.json @@ -8,7 +8,12 @@ "email": "", "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", "password": "Password", "confirm-password": "Confirm Password", diff --git a/languages/es_AR.json b/languages/es_AR.json old mode 100644 new mode 100755 diff --git a/languages/es_VE.json b/languages/es_VE.json old mode 100644 new mode 100755 diff --git a/languages/fr_FR.json b/languages/fr_FR.json index 0aadd039..a4faffd0 100755 --- a/languages/fr_FR.json +++ b/languages/fr_FR.json @@ -8,7 +8,12 @@ "email": "", "website": "" }, - + + "bludit-installer": "Installation de Bludit", + "welcome-to-the-bludit-installer": "Bienvenue dans l’assistant d’installation de Bludit", + "complete-the-form,-choose-a-password-for-the-username-«-admin-»": "Complétez le formulaire et choisissez un mot de passe pour l’utilisateur « admin »", + "password,-visible-field!": "Mot de passe, champ visible !", + "install": "Installer", "username": "Nom d’utilisateur", "password": "Mot de passe", "confirm-password": "Confirmation du mot de passe", diff --git a/languages/ja_JP.json b/languages/ja_JP.json old mode 100644 new mode 100755 diff --git a/languages/ru_RU.json b/languages/ru_RU.json old mode 100644 new mode 100755 diff --git a/languages/zh_TW.json b/languages/zh_TW.json old mode 100644 new mode 100755 From 2854c971482d930a1d17e06ca1b96807c19d65cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20K?= Date: Sun, 16 Aug 2015 14:33:33 +0200 Subject: [PATCH 2/2] Fix lang exist --- install.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/install.php b/install.php index e70cf8ae..7897f835 100755 --- a/install.php +++ b/install.php @@ -6,10 +6,9 @@ * Author Diego Najar * Bludit is opensource software licensed under the MIT license. */ - // Security constant define('BLUDIT', true); - + // Directory separator define('DS', DIRECTORY_SEPARATOR); @@ -61,7 +60,12 @@ include(PATH_ABSTRACT.'dbjson.class.php'); include(PATH_KERNEL.'dblanguage.class.php'); // Load language -$locale = Locale::acceptFromHttp($_SERVER['HTTP_ACCEPT_LANGUAGE']); +$HTTP_ACCEPT_LANGUAGE = Locale::acceptFromHttp($_SERVER['HTTP_ACCEPT_LANGUAGE']); +if (file_exists(PATH_LANGUAGES.$HTTP_ACCEPT_LANGUAGE. '.json')) { + $locale = $HTTP_ACCEPT_LANGUAGE; +} else { + $locale = 'en_US'; +} $Language = new dbLanguage($locale); // ============================================================================