User tests: Successful: Unsuccessful:
This improvement adds a new parameter to let display a bootstrap dropdown with flags and language names instead of the older dropdown. It is B/C. Test on Protostar. Beez3 is untouched by adding an override.
It was requested by many users on the forums.
Until now choosing dropdown display we would get:
New parameters in the language Switcher:
Results in frontend
Status | New | ⇒ | Pending |
Labels |
Added:
?
?
|
Category | ⇒ | Modules Multilanguage |
Labels |
I have tested this item successfully on 032bc44
Tested with success, works as described, also with reduced line height.
@infograf768 I'd like to ask 2 things:
Since the new option is only relevant if option "Use Dropdown" is true ("Yes"), should it not be moved to the bottom so it appears below the header "If Use Image Flags is set to 'Yes', the display options below will be ignored"? Otherwise, if it is like now, the text "Use Dropdown With Flags" could be a bit misleading, because it sounds as if it was an alternative to "Use Dropdown" and not an additional option for the dropdown. Something like "Use flags for dropdown" could be maybe more clear. Maybe @brianteeman has a suggestion for a better text in that case (position of the new option in GUI as shown in your screenshots).
I have not tested it with RTL direction. From my point of view, the flag should appear right beside the language name and all should be right aligned in case of RTL. Does it work like this?
IMHO mod_languages options should be reviewed.
There are a lot of text that is not needed if you use showon.
Some time ago i started working on that, but then i had other PRs to worry.
@infograf768 see andrepereiradasilva@9398442 if you want to use something. It's not tested and i don't recall where i left it, or even if it's BC.
@infograf768 I meanwhile have set up Arabic language for tesing RTL, and it seems that for each language in the list, the position of the flag depends on the RTL of the particular language in the list, and not on the RTL of the current langue, see adjusted screen shots:
Is this desired?
I would guess no. From my point of view the position of flags in the list should be according to the alignment of the list, i.e. if current language is RTL, flags of all languages in the list should be on the right side, and if current language is LTR, flags of all languages in the list should be on the left side.
Or am I wrong, or did something wrong when setting up the Arabic language, or do I not understand the desired behavior?
Please let me know if ok or not, so I can alter my test result if necessary.
Will deal with rtl matter.
@andrepereiradasilva
Now working on showon
Now working on showon
No changes in this PR. Forgot to sync?
Update: Sorry. Misunderstood your comment. You are working ON it now. Right!
This PR has received new commits.
CC: @richard67
Use Dropdown: Yes | Use Flags For Dropdown: No
Problems found: none.
Use Dropdown: Yes | Use Flags For Dropdown: Yes
Problems found: chosen.css is loaded but is not needed.
Use Dropdown: No | Use Image flags: Yes
Problems found: chosen.css is loaded but is not needed.
Use Dropdown: No | Use Image flags: No
Problems found: chosen.css is loaded but is not needed.
Didn't test RTL and beez3.
The rest is just small adjustments needed in loading chosen.css.
Nice work @infograf768.
Chosen.css is at this stage always loaded as your PR ( #9087 ) has not been merged.
If it had been, I would have changed the conditional to
if ($params->get('dropdown', 1) && !$params->get('dropdownimage', 0))
concerning
Test 1: Only dropdown (chosen)
Use Dropdown: Yes | Use Flags For Dropdown: No
Problems found:
"Active language" = "No" doesn't remove the active language
"Active language" = "Yes" doesn't add the lang-active class to the option.
This is normal and these parameters are useless in a "normal" select box. This is why they are hidden. This is the same as former behavior when dropdown was used.
Indeeed a small issue as Active language shows when Dropdown to Yes and Use flags for dropdown to no. Will try to correct.
Hmm, it seems that the showon there is fine. But at random, the Active Language field displays.
Let's see your showon for "show_active" is showon="image:1[OR]dropdownimage:1[OR]dropdown:0"
Shows if:
Is not random is when you have (Use Image Flags) set to Yes = image:1
The option could be hidden but setted to 1.
I meant I got sometimes the Active Language field displaying although the showon is OK.
Anyway my branch has conflicts. Will create another PR.
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-02-10 12:16:44 |
Closed_By | ⇒ | infograf768 |
replaced by
Cool, nice PR! Will test as soon as i have time.
As a suggestion: a similiar thing would be cool for the backend language selectors! (in a new PR of course)