aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgweltas <gweltas@piwigo.org>2004-03-27 13:24:26 +0000
committergweltas <gweltas@piwigo.org>2004-03-27 13:24:26 +0000
commit6a9c9eb91f349123850ddda0de18dde87f0565bb (patch)
tree28c5304252304a1197fb5a404c93f07b3fda6183
parenta2fe0444de049196fe203883fb426aa18e6a4b35 (diff)
- Split of infos.lang.php
git-svn-id: http://piwigo.org/svn/trunk@398 68402e56-0260-453c-a942-63ccdbb3a9ee
-rw-r--r--include/config.inc.php3
-rw-r--r--include/functions_user.inc.php4
-rw-r--r--include/htmlfunctions.inc.php12
-rw-r--r--include/page_header.php11
-rw-r--r--language/en_UK.iso-8859-1/common.lang.php7
-rw-r--r--language/en_UK.iso-8859-1/iso.txt1
-rw-r--r--language/infos.lang.php96
7 files changed, 19 insertions, 115 deletions
diff --git a/include/config.inc.php b/include/config.inc.php
index 92d3a73cc..72211789e 100644
--- a/include/config.inc.php
+++ b/include/config.inc.php
@@ -53,6 +53,5 @@ $conf['document_ext'] = array('doc','pdf','zip');
$conf['top_number'] = 10;
$conf['anti-flood_time'] = 60; // seconds between 2 comments : 0 to disable
$conf['max_LOV_categories'] = 50;
-$conf['default_style'] = 'default';
-$conf['default_lang'] = 'en_EN';
+
?>
diff --git a/include/functions_user.inc.php b/include/functions_user.inc.php
index cf3f01fb3..400e104c6 100644
--- a/include/functions_user.inc.php
+++ b/include/functions_user.inc.php
@@ -230,8 +230,7 @@ function check_login_authorization()
function init_userprefs($userdata)
{
global $conf, $template, $lang, $lang_info;
- include_once(PHPWG_ROOT_PATH . 'language/infos.lang.php');
-
+
$language = (!empty($userdata['language']) && !$userdata['is_the_guest'] )?$userdata['language']:$conf['default_lang'];
$style = (!empty($userdata['template'])&& !$userdata['is_the_guest'] )?$userdata['template']:$conf['default_style'];
@@ -251,7 +250,6 @@ function init_userprefs($userdata)
include_once(PHPWG_ROOT_PATH . 'language/' . $language . '/admin.lang.php');
}
- $lang_info['current_code']=$language;
$template= setup_style($style);
return;
}
diff --git a/include/htmlfunctions.inc.php b/include/htmlfunctions.inc.php
index 8377f8e35..25b330ff3 100644
--- a/include/htmlfunctions.inc.php
+++ b/include/htmlfunctions.inc.php
@@ -112,17 +112,17 @@ function create_navigation_bar( $url, $nb_element, $start,
//
function language_select($default, $select_name = "language")
{
- global $lang_info;
+
$dir = opendir(PHPWG_ROOT_PATH . 'language');
$available_lang= array();
while ( $file = readdir($dir) )
{
- if (is_dir ( realpath(PHPWG_ROOT_PATH.'language/'.$file) )
- && !is_link(realpath(PHPWG_ROOT_PATH . 'language/' . $file))
- && isset($lang_info['language'][$file]))
+ $path= realpath(PHPWG_ROOT_PATH . 'language/'.$file);
+ if (is_dir ($path) && !is_link($path) && file_exists($path . '/iso.txt'))
{
- $available_lang[$file] = $lang_info['language'][$file];
+ list($displayname) = @file($path . '/iso.txt');
+ $available_lang[$displayname] = $file;
}
}
closedir($dir);
@@ -130,7 +130,7 @@ function language_select($default, $select_name = "language")
@reset($available_lang);
$lang_select = '<select name="' . $select_name . '" onchange="this.form.submit()">';
- while ( list($code, $displayname) = @each($available_lang) )
+ foreach ($available_lang as $displayname => $code)
{
$selected = ( strtolower($default) == strtolower($code) ) ? ' selected="selected"' : '';
$lang_select .= '<option value="' . $code . '"' . $selected . '>' . ucwords($displayname) . '</option>';
diff --git a/include/page_header.php b/include/page_header.php
index 6067c65e8..08572804d 100644
--- a/include/page_header.php
+++ b/include/page_header.php
@@ -30,17 +30,12 @@
//
$template->set_filenames(array('header'=>'header.tpl'));
-$charset = empty($lang_info['charset'][$lang_info['current_code']])?
- $lang_info['default']['charset']:$lang_info['charset'][$lang_info['current_code']];
-$dir = empty($lang_info['direction'][$lang_info['current_code']])?
- $lang_info['default']['direction']:$lang_info['direction'][$lang_info['current_code']];
-
$css = PHPWG_ROOT_PATH.'template/'.$user['template'].'/'.$user['template'].'.css';
$template->assign_vars(array(
- 'CONTENT_ENCODING' => $charset,
+ 'CONTENT_ENCODING' => $lang_info['charset'],
'PAGE_TITLE' => $title,
- 'LANG'=>substr($lang_info['current_code'],0,2),
- 'DIR'=>$dir,
+ 'LANG'=>$lang_info['code'],
+ 'DIR'=>$lang_info['direction'],
'T_STYLE' => $css
));
diff --git a/language/en_UK.iso-8859-1/common.lang.php b/language/en_UK.iso-8859-1/common.lang.php
index cf960354a..2ca66b1ff 100644
--- a/language/en_UK.iso-8859-1/common.lang.php
+++ b/language/en_UK.iso-8859-1/common.lang.php
@@ -25,6 +25,13 @@
// | USA. |
// +-----------------------------------------------------------------------+
+// Langage informations
+$lang_info['language_name'] = 'English';
+$lang_info['country'] = 'Great Britain';
+$lang_info['charset'] = 'iso-8859-1';
+$lang_info['direction'] = 'ltr';
+$lang_info['code'] = 'en';
+
// Main words
$lang['gallery_index'] = 'Gallery index';
diff --git a/language/en_UK.iso-8859-1/iso.txt b/language/en_UK.iso-8859-1/iso.txt
new file mode 100644
index 000000000..043ea105e
--- /dev/null
+++ b/language/en_UK.iso-8859-1/iso.txt
@@ -0,0 +1 @@
+English [UK] \ No newline at end of file
diff --git a/language/infos.lang.php b/language/infos.lang.php
deleted file mode 100644
index c34d7df2c..000000000
--- a/language/infos.lang.php
+++ /dev/null
@@ -1,96 +0,0 @@
-<?php
-// +-----------------------------------------------------------------------+
-// | infos.lang_info.php |
-// +-----------------------------------------------------------------------+
-// | application : PhpWebGallery <http://phpwebgallery.net> |
-// | branch : 1.4 |
-// +-----------------------------------------------------------------------+
-// | file : $RCSfile$
-// | last update : $Date$
-// | last modifier : $Author$
-// | revision : $Revision$
-// +-----------------------------------------------------------------------+
-// | This program 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 |
-// | |
-// | This program 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. |
-// | |
-// | You should have received a copy of the GNU General Public License |
-// | along with this program; if not, write to the Free Software |
-// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
-// | USA. |
-// +-----------------------------------------------------------------------+
-
-$lang_info['language']['zh_CN'] = '&#31616;&#20307;&#20013;&#25991;'; // Simplified Chinese
-$lang_info['language']['zh_TW'] = '&#32321;&#39636;&#20013;&#25991;'; // Traditional Chinese
-$lang_info['language']['zh_TW.utf8'] = '&#32321;&#39636;&#20013;&#25991; (UTF-'; // Traditional Chinese (UTF-
-$lang_info['language']['bg_BG'] = '&#x0411;&#x044a;&#x043b;&#x0433;&#x0430;&#x0440;&#x0441;&#x043a;&#x0438;'; // Bulgarian
-$lang_info['language']['ca_ES'] = 'Catal&#xe0;'; // Catalan
-$lang_info['language']['cs_CZ'] = '&#x010c;esky'; // Czech
-$lang_info['language']['cs_CZ.cp1250'] = '&#x010c;esky CP'; // Czech
-$lang_info['language']['cs_CZ.iso'] = '&#x010c;esky ISO'; // Czech
-$lang_info['language']['da_DK'] = 'Dansk'; // Danish
-$lang_info['language']['de_DE'] = 'Deutsch'; // German
-$lang_info['language']['en_EN'] = 'English';
-$lang_info['language']['en_GB'] = 'English (UK)';
-$lang_info['language']['en_US'] = 'English (US)';
-$lang_info['language']['es_ES'] = 'Espa&#241;ol'; // Spanish
-$lang_info['language']['fr_FR'] = 'Fran&#231;ais'; // French
-$lang_info['language']['it_IT'] = 'Italiano'; // Italian
-$lang_info['language']['he_IL'] = '&#1506;&#1489;&#1512;&#1497;&#1514;'; // Hebrew
-$lang_info['language']['is_IS'] = '&#205;slenska'; // Icelandic
-$lang_info['language']['ja_JP'] = '&#x65e5;&#x672c;&#x8a9e; (EUC-JP)'; // Japanese (EUC-JP)
-$lang_info['language']['ko_KR'] = '&#xd55c;&#xad6d;&#xc5b4;'; // Korean
-$lang_info['language']['lt_LT'] = 'Lietuvi&#x0173;'; // Lithuanian
-$lang_info['language']['hu_HU'] = 'Magyar'; // Hungarian
-$lang_info['language']['nl_NL'] = 'Nederlands'; // Dutch
-$lang_info['language']['no_NO'] = 'Norsk bokm&#229;l'; // Norwegian (Bokmal)
-$lang_info['language']['pl_PL'] = 'Polski'; // Polish
-$lang_info['language']['pt_PT'] = 'Portugu&#234;s'; // Portuguese
-$lang_info['language']['pt_BR'] = 'Portugu&#234;s Brasileiro'; // Portuguese (Brazil)
-$lang_info['language']['ru_RU'] = '&#x0420;&#x0443;&#x0441;&#x0441;&#x043a;&#x0438;&#x0439; (Windows)'; // Russian (Windows)
-$lang_info['language']['ru_RU.koi8r'] = '&#x0420;&#x0443;&#x0441;&#x0441;&#x043a;&#x0438;&#x0439; (KOI8-R)'; // Russian (KOI8-R)
-$lang_info['language']['sl_SI'] = 'Sloven&#x0161;&#x010d;ina'; // Slovenian
-$lang_info['language']['fi_FI'] = 'Suomi'; // Finnish
-$lang_info['language']['sv_SE'] = 'Svenska'; // Swedish
-$lang_info['language']['tr_TR'] = 'T&#252;rk&#231;e'; // Turkish
-$lang_info['language']['uk_UA'] = '&#x0423;&#x043a;&#x0440;&#x0430;&#x0457;&#x043d;&#x0441;&#x044c;&#x043a;&#x0430;'; // Ukranian
-
-/**
- ** Charsets
- **
- ** Add your own charsets, if your system uses others than "normal"
- **
- **/
-
- $lang_info['default']['charset'] = 'ISO-8859-1';
-
- $lang_info['charset']['bg_BG'] = 'windows-1251';
- $lang_info['charset']['cs_CZ'] = 'ISO-8859-2';
- $lang_info['charset']['he_IL'] = 'windows-1255';
- $lang_info['charset']['hu_HU'] = 'ISO-8859-2';
- $lang_info['charset']['ja_JP'] = 'EUC-JP';
- $lang_info['charset']['ko_KR'] = 'EUC-KR';
- $lang_info['charset']['lt_LT'] = 'windows-1257';
- $lang_info['charset']['pl_PL'] = 'ISO-8859-2';
- $lang_info['charset']['ru_RU'] = 'windows-1251';
-
- $lang_info['charset']['sl_SI'] = 'ISO-8859-2';
- $lang_info['charset']['tr_TR'] = 'ISO-8859-9';
- $lang_info['charset']['uk_UA'] = 'KOI8-U';
- $lang_info['charset']['zh_CN'] = 'GB2312';
- $lang_info['charset']['zh_TW'] = 'BIG5';
-
-
-/**
- ** Direction
- **/
-
- $lang_info['default']['direction'] = 'ltr';
- $lang_info['direction']['he_IL'] = 'rtl' ;
-
-?> \ No newline at end of file