You are here

function theme_i18n_language_icon in Internationalization 5.3

Same name and namespace in other branches
  1. 5 i18n.module \theme_i18n_language_icon()
  2. 5.2 i18n.module \theme_i18n_language_icon()

Theme language icon

This function can be overridden for no language icons

1 theme call to theme_i18n_language_icon()
theme_i18n_link in ./i18n.module
Produces a language link with the right flag

File

./i18n.module, line 724
Internationalization (i18n) module

Code

function theme_i18n_language_icon($lang) {
  if ($path = variable_get('i18n_icon_path', drupal_get_path('module', 'i18n') . '/flags/*.png')) {
    $languages = i18n_supported_languages();
    $src = base_path() . str_replace('*', $lang, $path);
    list($width, $height) = explode('x', variable_get('i18n_icon_size', '16x12'));
    $attribs = array(
      'class' => 'i18n-icon',
      'width' => $width,
      'height' => $height,
      'alt' => $languages[$lang],
    );
    return "<img src=\"{$src}\" " . drupal_attributes($attribs) . " />";
  }
}