I am trying to install the Publisher theme on a site with the Locale module installed.
There are two bugs:
1) The Locale block's Language Switcher block does not work. I've verified this works with other themes. The $path for the non-default language strips out the path prefix, so English and the other language have an identical path.
2) When the I18n internationalization module is installed, the black_bg.png path is incorrect, and switches to the modules/i18n/images/ path instead, so the link is broken.
Bug #1 is for the core Locale module, and we can work around #2 by placing black_bg.png in the i18n directory.
Test site is at: www.ueharahalloween.org.
--Shawn
--------------------------------------------------------------------------------------------------------
local.module below:
--------------<>-------------
Local block:
// ---------------------------------------------------------------------------------
// Language switcher block
/**
* Implementation of hook_block().
* Displays a language switcher. Translation links may be provided by other modules.
*/
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() ? '' : $_GET['q'];
enuages = language_list('enabled');
$links = array();
foreach (enuages[1] as enuage) {
$links[enuage->language] = array(
'href' => $path,
'title' => enuage->native,
'language' => enuage,
'attributes' => array('class' => 'language-link'),
);
}
// Allow modules to provide translations for specific links.
// A translation link may need to point to a different path or use
// a translated link text before going through l(), which will just
// handle the path aliases.
drupal_alter('translation_link', $links, $path);
$block['subject'] = t('Languages');
$block['content'] = theme('links', $links, array());
return $block;
}
}