From 5709cc3a2799926a519db8b683a5beca7ba310a7 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sun, 13 Jun 2004 21:31:21 +0000 Subject: [PATCH] availible languages now only need to be added to setup/lang/languages to be availible in eGW: - saves a db-update whenever a new lang comes availible - maybe we should drop the availible column in phpgw_languages --- setup/index.php | 13 +++++-------- setup/lang.php | 8 +++----- setup/lang/languages | 23 +++++++++++++++-------- 3 files changed, 23 insertions(+), 21 deletions(-) diff --git a/setup/index.php b/setup/index.php index 2c182a213b..a09cc258e3 100644 --- a/setup/index.php +++ b/setup/index.php @@ -427,19 +427,16 @@ $setup_tpl->set_var('lang_table_data',$btn_install_lang); break; case 10: - $langs_list = ''; - reset ($GLOBALS['phpgw_info']['setup']['installed_langs']); - while (list ($key, $value) = each ($GLOBALS['phpgw_info']['setup']['installed_langs'])) + $langs_list = array(); + $languages = get_langs(); + foreach ($GLOBALS['phpgw_info']['setup']['installed_langs'] as $key => $value) { - if($value) - { - $langs_list .= ($langs_list?', ':'') . $value; - } + $langs_list[] = isset($languages[$key]) ? $languages[$key]['descr'] : $value; } $setup_tpl->set_var('lang_status_img',$completed); $setup_tpl->set_var('lang_status_alt','completed'); $btn_manage_lang = $GLOBALS['phpgw_setup']->html->make_frm_btn_simple( - lang('This stage is completed
') . lang('Currently installed languages: %1
',$langs_list), + lang('This stage is completed
') . lang('Currently installed languages: %1
',implode(', ',$langs_list)), 'POST','lang.php', 'submit',lang('Manage Languages'), ''); diff --git a/setup/lang.php b/setup/lang.php index 4b2179f077..7425430d75 100644 --- a/setup/lang.php +++ b/setup/lang.php @@ -61,15 +61,13 @@ } $select_box_desc = lang('Select which languages you would like to use'); $select_box = ''; - $GLOBALS['phpgw_setup']->db->query($q="SELECT lang_id,lang_name FROM phpgw_languages WHERE available='Yes' ORDER BY lang_name"); - while ($GLOBALS['phpgw_setup']->db->next_record()) + foreach(get_langs() as $id => $data) { - $id = $GLOBALS['phpgw_setup']->db->f('lang_id'); $select_box_langs = @$select_box_langs .'' + .(@$GLOBALS['phpgw_info']['setup']['installed_langs'][$id]?' SELECTED="1"':'').'>' + . $data['descr'] . '' ."\n"; } diff --git a/setup/lang/languages b/setup/lang/languages index 497449459c..833f75cf25 100644 --- a/setup/lang/languages +++ b/setup/lang/languages @@ -1,18 +1,25 @@ -en English +cs Czech +da Danish de Deutsch -es Español +en English +el Greek +es-es Español +es-ca Catalan fi Suomi fr Français +hu Hungarian it Italiano ja Japanese ko Korean -zh Chinese(simplified) -zt Chinese(Taiwan) -pt Portuguese -hu Hungarian -da Danish nl Dutch no Norwegian -sv Swedish pl Polski +pt Portuguese +pt-br Brazil +hu Hungarian +ru Russian sl Slovensko +sv Swedish +uk Ukrainian +zh simplified Chinese +zt traditional Chinese (Taiwan)