Fix lang exist

This commit is contained in:
Frédéric K 2015-08-16 14:33:33 +02:00
parent 2bbd0aba16
commit 2854c97148
1 changed files with 7 additions and 3 deletions

View File

@ -6,10 +6,9 @@
* Author Diego Najar * Author Diego Najar
* Bludit is opensource software licensed under the MIT license. * Bludit is opensource software licensed under the MIT license.
*/ */
// Security constant // Security constant
define('BLUDIT', true); define('BLUDIT', true);
// Directory separator // Directory separator
define('DS', DIRECTORY_SEPARATOR); define('DS', DIRECTORY_SEPARATOR);
@ -61,7 +60,12 @@ include(PATH_ABSTRACT.'dbjson.class.php');
include(PATH_KERNEL.'dblanguage.class.php'); include(PATH_KERNEL.'dblanguage.class.php');
// Load language // 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); $Language = new dbLanguage($locale);
// ============================================================================ // ============================================================================