You are here

function translation_block in Internationalization 5

Same name and namespace in other branches
  1. 5.3 translation/translation.module \translation_block()
  2. 5.2 translation/translation.module \translation_block()

Implementation of hook_block().

This is a simple language switcher which knows nothing about translations

File

translation/translation.module, line 154

Code

function translation_block($op = 'list', $delta = 0) {
  if ($op == 'list') {
    $blocks[0]['info'] = t('Translations');
  }
  elseif ($op == 'view') {
    $blocks['subject'] = t('Languages');
    $query = drupal_query_string_encode($_GET, array(
      'q',
    ));
    $blocks['content'] = theme('item_list', translation_get_links($_GET['q'], empty($query) ? NULL : $query));
  }
  return $blocks;
}