function locale_block_view
locale_block_view($type)
Implements hook_block_view().
Displays a language switcher. Only show if we have at least two languages.
File
- modules/locale/locale.module, line 1037
- Add language handling functionality and enables the translation of the user interface to languages other than English.
Code
function locale_block_view($type) { if (drupal_multilingual()) { $path = drupal_is_front_page() ? '<front>' : $_GET['q']; $links = language_negotiation_get_switch_links($type, $path); if (isset($links->links)) { drupal_add_css(drupal_get_path('module', 'locale') . '/locale.css'); $class = "language-switcher-{$links->provider}"; $variables = array('links' => $links->links, 'attributes' => array('class' => array($class))); $block['content'] = theme('links__locale_block', $variables); $block['subject'] = t('Languages'); return $block; } } }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!locale!locale.module/function/locale_block_view/7.x