diff options
author | gweltas <gweltas@piwigo.org> | 2004-03-27 13:24:26 +0000 |
---|---|---|
committer | gweltas <gweltas@piwigo.org> | 2004-03-27 13:24:26 +0000 |
commit | 6a9c9eb91f349123850ddda0de18dde87f0565bb (patch) | |
tree | 28c5304252304a1197fb5a404c93f07b3fda6183 | |
parent | a2fe0444de049196fe203883fb426aa18e6a4b35 (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.php | 3 | ||||
-rw-r--r-- | include/functions_user.inc.php | 4 | ||||
-rw-r--r-- | include/htmlfunctions.inc.php | 12 | ||||
-rw-r--r-- | include/page_header.php | 11 | ||||
-rw-r--r-- | language/en_UK.iso-8859-1/common.lang.php | 7 | ||||
-rw-r--r-- | language/en_UK.iso-8859-1/iso.txt | 1 | ||||
-rw-r--r-- | language/infos.lang.php | 96 |
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'] = '简体中文'; // Simplified Chinese -$lang_info['language']['zh_TW'] = '繁體中文'; // Traditional Chinese -$lang_info['language']['zh_TW.utf8'] = '繁體中文 (UTF-'; // Traditional Chinese (UTF- -$lang_info['language']['bg_BG'] = 'Български'; // Bulgarian -$lang_info['language']['ca_ES'] = 'Català'; // Catalan -$lang_info['language']['cs_CZ'] = 'Česky'; // Czech -$lang_info['language']['cs_CZ.cp1250'] = 'Česky CP'; // Czech -$lang_info['language']['cs_CZ.iso'] = 'Č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ñol'; // Spanish -$lang_info['language']['fr_FR'] = 'Français'; // French -$lang_info['language']['it_IT'] = 'Italiano'; // Italian -$lang_info['language']['he_IL'] = 'עברית'; // Hebrew -$lang_info['language']['is_IS'] = 'Íslenska'; // Icelandic -$lang_info['language']['ja_JP'] = '日本語 (EUC-JP)'; // Japanese (EUC-JP) -$lang_info['language']['ko_KR'] = '한국어'; // Korean -$lang_info['language']['lt_LT'] = 'Lietuvių'; // Lithuanian -$lang_info['language']['hu_HU'] = 'Magyar'; // Hungarian -$lang_info['language']['nl_NL'] = 'Nederlands'; // Dutch -$lang_info['language']['no_NO'] = 'Norsk bokmål'; // Norwegian (Bokmal) -$lang_info['language']['pl_PL'] = 'Polski'; // Polish -$lang_info['language']['pt_PT'] = 'Português'; // Portuguese -$lang_info['language']['pt_BR'] = 'Português Brasileiro'; // Portuguese (Brazil) -$lang_info['language']['ru_RU'] = 'Русский (Windows)'; // Russian (Windows) -$lang_info['language']['ru_RU.koi8r'] = 'Русский (KOI8-R)'; // Russian (KOI8-R) -$lang_info['language']['sl_SI'] = 'Slovenščina'; // Slovenian -$lang_info['language']['fi_FI'] = 'Suomi'; // Finnish -$lang_info['language']['sv_SE'] = 'Svenska'; // Swedish -$lang_info['language']['tr_TR'] = 'Türkçe'; // Turkish -$lang_info['language']['uk_UA'] = 'Українська'; // 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 |