Skip to content

Instantly share code, notes, and snippets.

@gagarine
Created November 19, 2012 09:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gagarine/4109794 to your computer and use it in GitHub Desktop.
Save gagarine/4109794 to your computer and use it in GitHub Desktop.
Two chars language name in drupal's language switcher
/**
* theme_link for local block.
*
* Get language code as language switcher link (two chars)
*
* @param type $variables
* @return type
*/
function THEME_links__locale_block($variables) {
foreach ($variables['links'] as $key => $value) {
$lang = $value['language']->language;
$variables['links'][$key]['title'] = drupal_strtoupper($lang);
}
return theme('links', $variables);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment