how to show language switching flags on drupal site?

    Use this custom code wheather in a page.tpl.php file or you can use it in creating a new drupal block and showing block in the particular region Place the flag images in you theme folder named like fr.png for (French) en.png for (English) etc.
    <?php
    $lang_links
    = array();
    foreach (
    language_list() as $language) {
     
    //genrate the image name
     
    $image = '/'. $language->language.'.png';
     
    //adding link information to the array
     
    $lang_links[$language->language] = array('href' => $_GET['q'], 'title' => $language->native, 'image' => $image, 'name' =>    $language->name, 'options' => array('language' => $language, 'attributes' => array('class' => 'language_link'), 'html' => true));
    }
    // Allow modules to provide translations for specific paths for the links
    drupal_alter('translation', $lang_links, $_GET['q']);
    foreach (
    $lang_links as $datalink) {
     
    $flag = '<img title="'. $datalink['name'].'" alt="'. $link['title'] .'" src="' .base_path().path_to_theme().$datalink['image'] .'"/>';
     
    $output .= l($flag, $link['href'], $link['options']);
    }
    print
    $output;
    ?>
    Note: Remember to install languages and enable the path prefix option from the configuration settings
    5
    Average: 5 (1 vote)