Community Documentation

Customizing the ui locale switching block

Last updated November 6, 2012. Created by Roberto Gerola on January 22, 2007.
Edited by frederickjh. Log in to edit this page.

In a block with input format PHP add this code :

<?php
$languages
=localizer_block_switchuilocale_links(variable_get('localizer_switchblock_showflags', TRUE), variable_get('localizer_switchblock_showlangname',TRUE), variable_get('localizer_switchblock_flagseparator', ' ', FALSE));

echo
'<ul>';
foreach(
$languages as $i=>$link) {
  echo
'<li>' . $link . '</li>';
}
echo
'</ul>';
?>

The syntax of localizer_block_switchuilocale_links function is :

localizer_block_switchuilocale_links($flags=TRUE, $names=TRUE, $separator = ' ', $setcurrentactive)

$flags : show/hide the flags
$names : show /hide the languages names
$separator : separation text between flags and names
$setcurrentactive : highlights the current language

Page status

About this page

Drupal version
Drupal 5.x

Archive

Drupal’s online documentation is © 2000-2013 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution-ShareAlike 2.0. PHP code is distributed under the GNU General Public License. Comments on documentation pages are used to improve content and then deleted.
nobody click here