- 🇮🇹Italy apaderno Brescia, 🇮🇹
I am closing this issue, since it is for a Drupal version that now is not supported.
Please re-open it if the issue is also relevant for other project branches that require a supported Drupal version.
Hello
I'm asking for a little help. I'd like to display the language switcher list as a drop-down list, so when the user selects a language he's automatically redirect, without a button to click. I got inspiration from this issue from i18n.
Here is the code I've put in template.php :
/**
* Override of theme_languageswitcher()
* Provided by languageinterface.module
*
* @param $links
* An array of all enabled languages links
*/
function zen_ninesixty_languageswitcher($links) {
$output = '<form name="language-form">';
$output .= '<select id="language-interface" onchange="window.location=document.language-form.language-interface.options[document.language-form.language-interface.selectedIndex].value;" value="GO">';
foreach($links as $link) {
$output .= '<option value="'. $link['path'] .'">';
$output .= $link['text'];
$output .= '</option>';
}
$output .= "</select>";
$output .= "</form>";
return $output;
}
The HTML output is correct, values and paths are properly populated. But nothing happens when I select a language... I tried 'onselect' instead of 'onchange', 'window.location.href' too, but nothing makes it...
Any hint really appreciated !
Closed: outdated
2.5
Miscellaneous
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
I am closing this issue, since it is for a Drupal version that now is not supported.
Please re-open it if the issue is also relevant for other project branches that require a supported Drupal version.