diff --git a/plugins/language_switch/language_switch.inc.php b/plugins/language_switch/language_switch.inc.php
index 5ae57956f..2a5c37dbc 100644
--- a/plugins/language_switch/language_switch.inc.php
+++ b/plugins/language_switch/language_switch.inc.php
@@ -1,11 +1,4 @@
- $displayname )
-{
- $qlc_url = add_url_params( make_index_url(), array( 'lang' => $code ) );
- $qlc_alt = ucwords( $displayname );
- $qlc_title = $qlc_alt;
- $qlc_img = PHPWG_PLUGINS_PATH.'language_switch/icons/'
+ global $user, $template;
+ $available_lang = get_languages();
+ foreach ( $available_lang as $code => $displayname )
+ {
+ $qlc_url = add_url_params( make_index_url(), array( 'lang' => $code ) );
+ $qlc_alt = ucwords( $displayname );
+ $qlc_title = $qlc_alt;
+ $qlc_img = PHPWG_PLUGINS_PATH.'language_switch/icons/'
. $code . '.gif';
- // echo $code . ' '. $qlc_url .' //
';
- // echo $user['language'] . ' '. $qlc_img .' ///
';
if ( $code !== $user['language'] and file_exists($qlc_img) )
- {
- $template -> concat_var( 'PLUGIN_INDEX_ACTIONS',
- '