3 * Copyright 2007 Tomáš Klapka aka klip (tomas@klapka.cz)
4 * This file is part of Vanilla.
5 * Vanilla is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
6 * Vanilla is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
7 * You should have received a copy of the GNU General Public License along with Vanilla; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
8 * The latest source code for Vanilla is available at www.lussumo.com
10 * Description: Initialization of settings
14 // this is just for the case I would want to change the name of this extension which is unlikely
15 // if it happens, there is still needed to change extension name in lines including this settings file
16 $LL_extension_name = 'ExtensionLanguageLoader';
18 // turn on/off debug info
22 $LL_dir_app = $Configuration['APPLICATION_PATH'];
23 $LL_dir_ext = $Configuration['EXTENSIONS_PATH'];
24 $LL_dir_lang = $Configuration['LANGUAGES_PATH'];
25 $LL_dir_conf = $LL_dir_app.'conf/';
26 $LL_root = $LL_dir_ext.$LL_extension_name.'/';
27 $LL_root_conf = $LL_root.'conf/';
28 $LL_root_lib = $LL_root.'library/';
31 @require
( $LL_root_conf.'settings.php' );
33 // set another initial settings depending on settings
34 $LL_dir_cache = $LL_dir_conf.$LL_cache_folder_name.'/';
36 // read dictionary definitions
37 @include
( $LL_root_conf.'definitions.php' );
39 // get user language preferences settings
40 $LL_lang_main = $Configuration['LANGUAGE'];
41 if ( $Configuration['LANGUAGE_PRIORITIES'] ) {
42 $LL_lang_priorities = split( ',', $Configuration['LANGUAGE_PRIORITIES'] );
44 $LL_lang_priorities = Array( $LL_lang_main );
46 // if first lang is not the main one then insert it to the first place
47 if ( $LL_lang_priorities[0] != $LL_lang_main ) {
48 array_unshift( $LL_lang_priorities, $LL_lang_main );
50 // make sure there are no duplicit values
51 $LL_lang_priorities = array_unique( $LL_lang_priorities );
53 // put "(lang-code) " in front of lower definitions
54 $LL_prefix_lower_langs = true;
55 if ($Configuration['LANGUAGE_PRIORITIES_HIDE_CODE'] == '1') {
56 $LL_prefix_lower_langs = false;
59 // create cache file name
60 $LL_lang_settings = Implode( ',,', $LL_lang_priorities);
61 $LL_cache_file = $LL_dir_cache.$LL_lang_settings.'.php';