Hi there,
I am developping a english/french site and I want to customize a language selector in tpl_header.php
If I am in french section, I want to display a link to english section with "English" label.
Else, if I am in english section, I want to display a link to french section with "Français" label.
I need to know how I can retrieve the actual language in use to built / display the appropriate link.
I started with this code below, which display a flag for every language available. I observed that when I change language, I got a "language" attribute in the URL but this attribute dissapear when going to another page.
Then my question is: Is there a global php variable from which I can retrieve the actual language in use ?PHP Code:<?php
if (!isset($lng) || (isset($lng) && !is_object($lng))) {
$lng = new language;
}
reset($lng->catalog_languages);
while (list($key, $value) = each($lng->catalog_languages)) {
echo '<a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('language', 'currency')) . 'language=' . $key, $request_type) . '">' . zen_image(DIR_WS_LANGUAGES.$value['directory'].'/images/'.$value['image'], $value['name'], '', '', ' style="vertical-align:middle;"') . '</a>';
}
?>
Thank's a lot!![]()





