Closed (fixed)
Project:
Language Switcher Dropdown
Version:
7.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
1 Nov 2011 at 20:40 UTC
Updated:
24 Feb 2012 at 01:20 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
alexpls commentedI have this problem as well. Although I wasn't able to come up with a fix while briefly looking at lang_dropdown's code, I was able to get the desired look by just specifying this in my page's CSS:
It's not a proper fix, but it works!
Comment #2
Anonymous (not verified) commentedI've got the same problem. In FF is works perfect but in IE, Opera or Chrome its broken: two icons placed, one icon works, one icon is missing
Comment #3
chiappa commentedSame thing. I tried Safari, Chrome & IE 8. All of them showed two flag icons, the other one being smaller for the default language. When changing to another language one of the icons turns into a question mark box.
The CSS trick from Alexpls fixed that for the default language in all of the browsers mentioned. For the other language it shows again two icons but this time both are question mark boxes.
Comment #4
eldarkhan commentedWOW. This is crazy but I went to languages > icons and set the size of icons 0 x 0. This is soo wrong, but it works ;)
Comment #5
Anonymous (not verified) commented@eldarkhan: Yeah, it only works at the default language site, not the other language. When I switched to other language site, no language icons showed and on both site, it gave the error as follows:
Notice: Undefined offset: 1 in theme_languageicons_icon() (line 120 of /mnt/home_folders/websites/jx2rehab/web/sites/all/modules/languageicons/languageicons.module).
Comment #6
Anonymous (not verified) commentedCan't even get rid of it now... :( So annoying.
How can we make the dropdown icons properly?
Any more suggestions? Thanks!
Comment #7
karens commentedThe problem is in the function lang_dropdown_form(). It is receiving an array called $language that has the language links with the icons already added to them, and then is adding the icons again.
Two parts of the code in that function need to be removed or adjusted for the fact the the icons are already there:
and
Deleting that code altogether fixes the problem for me.
Comment #8
zoszabo commentedResizing the icon worked for me too (removing the code does not:( ), but when i change language the icon disappeared if I don't use the original language.
I use the URL path to distinguish different languages therefore the new path after language change changes something in the path for the icons as well...
Can anyone help?
Comment #9
ytsurkremoving the code like in
#7works for meComment #10
floretan commentedI can confirm what Karen mentioned in #7. The icons are already part of the markup (working) and are also added using javascript (currently broken). The only reason why this seems to work in Firefox is that broken images are hidden by default. Missing images are requested on every page load, resulting in an additional server load.
Here's a patch that removes the code mentioned in #7, as well as the corresponding javascript code which isn't needed anymore.
Comment #11
danny englanderFor some reason the patch did not work for me, I tried:
git apply -v lang_dropdown_duplicate_icons-1328728-10.patchHowever, simply removing the code in #7 worked.
Comment #12
manfer commentedThe problem is that things are mexed up in drupal 7 version.
First and just to clarify this simple thing, the following piece of code does not really matter as $language_icon is always a blank string so that code is doing nothing at all. What this code was supposed to do in my opinion was to include the icon of current language appended or prepended to the select box when no dropdown js library is used but as it is now it is doing nothing.
Another thing to notice to understand all this issue is that the dropdown js library does not support to configure the place where to add the icon. On that library icons are always placed before the text. Though it is possible to move the icon after the text with CSS just coding a skin as dropdown library is skinable -in fact it comes with two skins-. A custom style can be added to dd.css to show the icon after the text and to choose the correct skin there is a parameter called "mainCSS".
This module is using the js library to add the icon and at same time is using the title from the language link in the code:
But that title has been hooked by language_icons module and includes the icon.
Because of this last line of code when you configure the language dropdown switcher block without the dropdown js library then the select shows something like:
without rendering the image.
---------
For all that in my opinion the solution would be first to remove the icon included by language_icons not using the title of the language link but the native language string.
That solves all the issues, the select without js dropdown library will show correctly and when using the js dropdown library only one icon will be shown.
But with that solution we lost the ability to choose the icon position (before/after) so to solve that we will need an alternative CSS to add to dd.css dropdown js library. A style that could be used to show icon after the text and could be passed as another argument to the function that creates the dropdown.
The only other thing that would need to be solved is to restore the inclusion of the icon before or after the select when the js library is not used and I thik that could be achieved with several changes, more or less restoring code that still is in the 6.x version. The lang_dropdown.css needs to be changed too because the selector of the select changes in drupal 7.
I attach a patch with all the changes.
Comment #13
manfer commentedI attach a new patch that besides doing what previous patch does, it upgrades msdropdown js library to last version 2.37.5 too.
Comment #14
manfer commentedNeeded a minor change in the msdropdown style that allows to show icon after the text as it was not working correctly in safari nor chrome.
Comment #15
manfer commented