1 locale.inc locale_language_switcher_url($type, $path)

Return links for the URL language switcher block.

Translation links may be provided by other modules.

Related topics

File

core/includes/locale.inc, line 361
Administration functions for locale.module.

Code

function locale_language_switcher_url($type, $path) {
  // Get the enabled languages only.
  $language_list = language_list(TRUE, TRUE, TRUE);
  $links = array();

  foreach ($language_list as $langcode => $label) {
    $links[$langcode] = array(
      'href' => $path,
      'title' => $label,
      'language' => language_load($langcode),
      'attributes' => array('class' => array('language-link')),
    );
  }

  return $links;
}