mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 22:10:45 +02:00
i am not sure if people will like the config layout i test here... it requires the framework at least being present
git-svn-id: file:///svn/phpbb/trunk@9281 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -56,74 +56,6 @@ else
|
||||
@ini_set('memory_limit', $mem_limit);
|
||||
*/
|
||||
|
||||
/* Try and load an appropriate language if required
|
||||
$language = basename(request_var('language', ''));
|
||||
|
||||
if (!empty($_SERVER['HTTP_ACCEPT_LANGUAGE']) && !$language)
|
||||
{
|
||||
$accept_lang_ary = explode(',', strtolower($_SERVER['HTTP_ACCEPT_LANGUAGE']));
|
||||
foreach ($accept_lang_ary as $accept_lang)
|
||||
{
|
||||
// Set correct format ... guess full xx_yy form
|
||||
$accept_lang = substr($accept_lang, 0, 2) . '_' . substr($accept_lang, 3, 2);
|
||||
|
||||
if (file_exists(PHPBB_ROOT_PATH . 'language/' . $accept_lang))
|
||||
{
|
||||
$language = $accept_lang;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
// No match on xx_yy so try xx
|
||||
$accept_lang = substr($accept_lang, 0, 2);
|
||||
if (file_exists(PHPBB_ROOT_PATH . 'language/' . $accept_lang))
|
||||
{
|
||||
$language = $accept_lang;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// No appropriate language found ... so let's use the first one in the language
|
||||
// dir, this may or may not be English
|
||||
if (!$language)
|
||||
{
|
||||
$dir = @opendir(PHPBB_ROOT_PATH . 'language');
|
||||
|
||||
if (!$dir)
|
||||
{
|
||||
die('Unable to access the language directory');
|
||||
exit;
|
||||
}
|
||||
|
||||
while (($file = readdir($dir)) !== false)
|
||||
{
|
||||
$path = PHPBB_ROOT_PATH . 'language/' . $file;
|
||||
|
||||
if (!is_file($path) && !is_link($path) && file_exists($path . '/iso.txt'))
|
||||
{
|
||||
$language = $file;
|
||||
break;
|
||||
}
|
||||
}
|
||||
closedir($dir);
|
||||
}
|
||||
|
||||
if (!file_exists(PHPBB_ROOT_PATH . 'language/' . $language))
|
||||
{
|
||||
die('No language found!');
|
||||
}
|
||||
|
||||
// And finally, load the relevant language files
|
||||
include(PHPBB_ROOT_PATH . 'language/' . $language . '/common.' . PHP_EXT);
|
||||
include(PHPBB_ROOT_PATH . 'language/' . $language . '/acp/common.' . PHP_EXT);
|
||||
include(PHPBB_ROOT_PATH . 'language/' . $language . '/acp/board.' . PHP_EXT);
|
||||
include(PHPBB_ROOT_PATH . 'language/' . $language . '/install.' . PHP_EXT);
|
||||
include(PHPBB_ROOT_PATH . 'language/' . $language . '/posting.' . PHP_EXT);
|
||||
|
||||
*/
|
||||
|
||||
// Initialize some common config variables
|
||||
phpbb::$config += array(
|
||||
'load_tplcompile' => true,
|
||||
|
Reference in New Issue
Block a user