Change language bar's active language
If you want your site's language bar's first item to be the active one change lines on locale.module:
function locale_block($op = 'list', $delta = 0) { if ($op == 'list') { $block[0]['info'] = t('Language switcher'); // Not worth caching. $block[0]['cache'] = BLOCK_NO_CACHE; return $block; } // Only show if we have at least two languages and language dependent // web addresses, so we can actually link to other language versions. elseif ($op == 'view' && variable_get('language_count', 1) > 1 && variable_get('language_negotiation', LANGUAGE_NEGOTIATION_NONE) != LANGUAGE_NEGOTIATION_NONE) { $path = drupal_is_front_page() ? '<front>' : $_GET['q']; $languages = language_list('enabled'); foreach ($languages[1] as $language) { 'href' => $path, 'title' => $language->native, 'language' => $language, ); }
with:
function locale_block($op = 'list', $delta = 0) { global $language; if ($op == 'list') { $block[0]['info'] = t('Language switcher'); // Not worth caching. $block[0]['cache'] = BLOCK_NO_CACHE; return $block; } // Only show if we have at least two languages and language dependent // web addresses, so we can actually link to other language versions. elseif ($op == 'view' && variable_get('language_count', 1) > 1 && variable_get('language_negotiation', LANGUAGE_NEGOTIATION_NONE) != LANGUAGE_NEGOTIATION_NONE) { $path = drupal_is_front_page() ? '<front>' : $_GET['q']; $languages = language_list('enabled'); 'href' => $path, 'title' => $language->native, 'language' => $language, ); foreach ($languages[1] as $my_language) { if($my_language !== $languages) { 'href' => $path, 'title' => $my_language->native, 'language' => $my_language, ); } }












Phillip (doğrulanmadı) on Ekim 21st 2011
Hi Bekir,
This is excellent. One small point. In english , lenght is spelled length.
best regards,
Phillip
Yeni yorum gönder