diff options
Diffstat (limited to '')
-rw-r--r-- | include/common.inc.php | 1 | ||||
-rw-r--r-- | include/functions.inc.php | 1 | ||||
-rw-r--r-- | include/functions_plugins.inc.php | 2 | ||||
-rw-r--r-- | include/functions_user.inc.php | 15 |
4 files changed, 14 insertions, 5 deletions
diff --git a/include/common.inc.php b/include/common.inc.php index 07d73ee6c..01e6869e1 100644 --- a/include/common.inc.php +++ b/include/common.inc.php @@ -149,6 +149,7 @@ if (defined('IN_ADMIN') and IN_ADMIN) { include_once(get_language_filepath('admin.lang.php')); } +trigger_action('loading_lang'); @include_once(get_language_filepath('local.lang.php')); // only now we can set the localized username of the guest user (and not in diff --git a/include/functions.inc.php b/include/functions.inc.php index 3593652e0..3a3ee5259 100644 --- a/include/functions.inc.php +++ b/include/functions.inc.php @@ -640,6 +640,7 @@ function redirect_html( $url , $msg = '', $refresh_time = 0) { $user = build_user( $conf['guest_id'], true); include_once(get_language_filepath('common.lang.php')); + trigger_action('loading_lang'); @include_once(get_language_filepath('local.lang.php')); list($tmpl, $thm) = explode('/', $conf['default_template']); $template = new Template(PHPWG_ROOT_PATH.'template/'.$tmpl, $thm); diff --git a/include/functions_plugins.inc.php b/include/functions_plugins.inc.php index 3eda2e3f8..204d4e315 100644 --- a/include/functions_plugins.inc.php +++ b/include/functions_plugins.inc.php @@ -33,7 +33,7 @@ register their functions to handle these events. An event is identified by a string. */ -define('PHPWG_PLUGINS_PATH',PHPWG_ROOT_PATH.'plugins/'); +define('PHPWG_PLUGINS_PATH', PHPWG_ROOT_PATH.'plugins/'); define('EVENT_HANDLER_PRIORITY_NEUTRAL', 50); diff --git a/include/functions_user.inc.php b/include/functions_user.inc.php index dba5072fb..5499eb86c 100644 --- a/include/functions_user.inc.php +++ b/include/functions_user.inc.php @@ -821,19 +821,26 @@ SELECT name * PhpWebGallery default language. * * @param string filename + * @param string dirname * @return string filepath */ -function get_language_filepath($filename) +function get_language_filepath($filename, $dirname = '') { global $user, $conf; + if (empty($dirname)) + { + $dirname = PHPWG_ROOT_PATH; + } + $dirname .= 'language'.'/'; + $directories = array(); if ( isset($user['language']) ) { - $directories[] = PHPWG_ROOT_PATH.'language/'.$user['language']; + $directories[] = $dirname.$user['language']; } - $directories[] = PHPWG_ROOT_PATH.'language/'.$conf['default_language']; - $directories[] = PHPWG_ROOT_PATH.'language/'.PHPWG_DEFAULT_LANGUAGE; + $directories[] = $dirname.$conf['default_language']; + $directories[] = $dirname.PHPWG_DEFAULT_LANGUAGE; foreach ($directories as $directory) { |