aboutsummaryrefslogtreecommitdiffstats
path: root/include/common.inc.php
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2005-09-27 21:57:14 +0000
committerplegall <plg@piwigo.org>2005-09-27 21:57:14 +0000
commit0c0ab6d700167e3a8c4f9734233ff70738b12e18 (patch)
treea157b099f09a79bdce02c1ca8e3af72bfff7624b /include/common.inc.php
parentb7b05eafc360c258d0d711625051ad10a840613b (diff)
- bug 168 fixed: crash when language file does not exists. Constant
PHPWG_DEFAULT_LANGUAGE added. New function get_language_filepath always used to find language files. git-svn-id: http://piwigo.org/svn/trunk@879 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include/common.inc.php')
-rw-r--r--include/common.inc.php25
1 files changed, 2 insertions, 23 deletions
diff --git a/include/common.inc.php b/include/common.inc.php
index fa0a7f3db..38b0e7de0 100644
--- a/include/common.inc.php
+++ b/include/common.inc.php
@@ -166,32 +166,11 @@ while ( $row =mysql_fetch_array( $result ) )
include(PHPWG_ROOT_PATH.'include/user.inc.php');
// language files
-$user_langdir = PHPWG_ROOT_PATH.'language/'.$user['language'];
-$conf_langdir = PHPWG_ROOT_PATH.'language/'.$conf['default_language'];
+include_once(get_language_filepath('common.lang.php'));
-if (file_exists($user_langdir.'/common.lang.php'))
-{
- include_once($user_langdir.'/common.lang.php');
-}
-else
-{
- include_once($conf_langdir.'/common.lang.php');
-}
-
-// The administration section requires 2 more language files
if (defined('IN_ADMIN') and IN_ADMIN)
{
- foreach (array('admin') as $section)
- {
- if (file_exists($user_langdir.'/'.$section.'.lang.php'))
- {
- include_once($user_langdir.'/'.$section.'.lang.php');
- }
- else
- {
- include_once($conf_langdir.'/'.$section.'.lang.php');
- }
- }
+ include_once(get_language_filepath('admin.lang.php'));
}
// only now we can set the localized username of the guest user (and not in