Problem/Motivation
With the introduction of the form language concept in #1498874: Provide language awareness to entity forms (introduce the form language concept), we will need a language switcher allowing to choose the form active language.
Proposed resolution
Agreement that a drop button as in #7
Remaining tasks
Done: mock ups.
Done: ui element chosen. (We need to figure out if this can be a regular language switcher block or if it will be a UI elelment placed inside the form itself.)
Done: initial implementation (proceeded since form language landed #1498874: Provide language awareness to entity forms (introduce the form language concept)).
Todo:
- refine according to feedback in #55. Contributor Task to create patch, and interdiff: http://drupal.org/node/1424598
- (waiting on refinement) manually test, after implementation. Contributor Task to manually test: http://drupal.org/node/1489010 (be sure to note browsers used)
- final screenshots, after implementation
User interface changes
API changes
todo: clarify if there would be api changes. (API changes/additions that would affect module, install profile, and theme developers, including examples of before/after code if appropriate)
Related
#1874102: Rename language switcher blocks (to differentiate content and UI)
| Comment | File | Size | Author |
|---|---|---|---|
| #57 | interdiff.1498880.56.57.txt | 936 bytes | yesct |
| #57 | 1498880-block-config-57.patch | 5.18 KB | yesct |
| #57 | pushed-down.png | 190.02 KB | yesct |
| #57 | no-push.png | 61.05 KB | yesct |
| #57 | pushed-down.png | 190.02 KB | yesct |
Comments
Comment #1
plachtagging
Comment #2
gábor hojtsySo I guess #1498874: Provide language awareness to entity forms (introduce the form language concept) should go first? :) Or would you like to get people going with making up ideas about this?
Comment #3
plachWell, surely some UX discussion could help here. However the implementation will have to wait for form language to land...
Comment #4
gábor hojtsyRetitling issue for updated thinking, that it should just be the language switcher block reused. Needs to be themed for Seven since it looks bad as-is.
Comment #5
ytsurki would work on this,
right now there is a list displayed, what would you imagine instead .. ?
there are also a lot of modules around that block. (dropdown, flags etc.)
could be some show/hide functionality for the list, useful if very big ..
also there are two blocks now (UI text / content) - probably they should have a different feeling
Comment #6
ytsurkhere again the broken screenshot:
Comment #7
draganerorThis is first suggestion (UX improvements).
So, what you think?
Comment #8
ytsurki like the approach; reuse of the standard - dropbutton (at least looks like it) - this will even be cross-theme !
maybe the title could be placed before, inlined.
Comment #9
gábor hojtsyWow, it is amazingly fascinating how close is this to Bojhan's suggestion from http://drupal.org/node/1282018#comment-6120798, amazing. Will let him know to look at this one :)
Comment #10
gábor hojtsyAlso, why would you use lowercase at the start? Just to satisfy the general use of this dropdown link link? Languages are uppercase...
Comment #11
draganerorIgnore the characters case, It was quick "design in browser" thing.
Comment #11.0
yesct commentedUpdated issue summary.
Comment #12
yesct commentedGood. Drop button seems to be the right way to go here, since the action of switching will be done right on picking (there is no additional save or switch button).
I'll update the issue summary.
If someone wants to code this up, go ahead and assign the issue to yourself. :) [edit: @plach do you think this could be picked up by someone? I am not sure what level of difficulty it is but it seemed like it might be not too hard for someone to come into.]
Comment #13
draganerorMaybe I can do it.
Just curious, do you consider to do it with:
What are preferences here? This is what determines this task hard or easy.
Comment #14
gábor hojtsy@Dragan Eror: I'd add a theme function override for the language list in the Seven theme (it does not currently have its own theme I think although it might in fact have). If/when blocks as plugins are committed, we could have instance settings on blocks, so we can set a block instance in the frontend theme to be a classic HTML list display and on the backend as a dropbutton.
Comment #15
yesct commentedI think this is the issue Gabor refers to: #1535868: Convert all blocks into plugins
We could get a start on this without worrying about that, or use one of the recent patches there, and do something on top of that.
I'm guessing this is a good issue for someone to jump into, but that it might be challenging (not novice).
The desired UI is agreed on, any initial patch is good at spurring on progress.
I'll update the issue summary remaining tasks.
Comment #15.0
yesct commentedUpdated issue summary with issue summary template and remaining tasks.
Comment #16
yesct commentedUpdated issue summary to add related issue: #1874102: Rename language switcher blocks (to differentiate content and UI)
Comment #16.0
yesct commentedUpdated issue summary remaining tasks to help someone jump in to this.
Comment #17
jibranI am going to work on this one. Going to create a language switcher block with drop button language list.
Comment #18
Gaelan commentedI'm working on this. Here are the options I can see:
I personally prefer the popbutton element because I think we need CSS, and I think the dropbutton is meant for "you haven't selected any of these options, select one now", instead of "this is your current option, you can switch to a new one if you want." Going to start on the popbutton.
Comment #19
Gaelan commentedNow that I think about it, we could also extend the existing dropbutton. I think this is the way to go.
Comment #20
yesct commentedI dont know implementation details of how to do that, but extending the existing dropbutton *sounds* better to me.
Comment #21
plachCurrently the language switcher is output as plain links, we should either alter them only for seven or have a dropbutton also in the default theme. Not sure this would be a good choice. Again a word from @Bojhan would be welcome.
Comment #22
andypostHere's a simple patch and screenshot.
The main problem that active item by default does not show active language, suppose
language_negotiation_get_switch_links()needs to be modified to order the listAnother issue that default block title is too big and probably we need to ship 2 css files to make this block float (rtl second one)
Comment #23
andypostAlso it's possible that block should know the default language and make a sort inside
Comment #25
plachIn #1874102: Rename language switcher blocks (to differentiate content and UI) we agreed about going for a just "Language" as title, if only one configurable langauge is enabled. This will probably happen in #1833022: Only display interface language detection options to customize more granularity .
Comment #26
andypostNot sure I get how to make default title for block, but it's title is not affected by the patch.
Just fixed tests
Comment #27
plachCan we get a screenshot of the language switcher in Bartik?
Comment #28
andypostConfiguring a block



Switch language (closed)
Switch language (open)
Comment #29
plachThanks, looks acceptable to me in Bartik too. As you were saying we probably need to change the order of links so that the current one is always first, i.e. the visible one.
Comment #30
draganerorHere is block config patch. Now it is possible to configure how you want to show languages in the block
Comment #31
draganerorAdding #SprintWeekend tag
Comment #32
plachFunctionally the patch looks good to me, but it seriously needs more styling work as now the language switcher has no margins and looks sloppy on most seven pages. We could consider floating the language switcher on the right to match Bojhan's proposal: #1282018-99: Improve UX of language-aware entity forms.
These labels do not look very user-friendly to me. What about:
This comment is not very informative.
Comment #33
yesct commentedupdating tags, looks a bit more reasonable (medium instead of challenging) with some specific things to fix.
also updating issue summary remaining tasks.
Comment #33.0
yesct commentedadded related novice issue to retitle blocks
Comment #33.1
yesct commentedupdated remaining tasks
Comment #34
yesct commentedTagging to show on the frontend section of http://www.drupal8multilingual.org/
Comment #35
yesct commentedit's been a while. I think ok to unassign.
@Gaelan post to get back into it. :)
Comment #36
Gaelan commentedYesCT: That's fine. I should have done so earlier.
Comment #37
yesct commented#22: 1498880-lang-22.patch queued for re-testing.
Comment #38
dagmita commented#30: 1498880-block-config-30.patch queued for re-testing.
Comment #40
jair commentedNeeds reroll
Comment #41
Karmen commentedRerolled #30 and run test.
Comment #42
Karmen commentedRerolled #30 and run test.
Comment #43.0
(not verified) commentedmoved done to done list
Comment #44
sutharsan commentedRerolled #44
Comment #45
dawehnerThis should be {@inheritdoc}
What about naming it "operations dropdown"? I had no idea what "Javascript operations" would be.
This comment is kinda pointless
Should we also add some test coverage that the operations are rendered properly?
Comment #46
macmladen commentedI'll take on this
Comment #47
emma.mariaActions in #45 still needs to be completed, setting to Needs work and unassigning as no movement in 4 months.
Comment #48
emma.mariaComment #49
plachComment #50
lauriiiComment #51
lauriiiComment #53
lauriiiComment #54
yesct commentedI read all the lines of the patch. Looks good to me.
===
just a little clean up in the test:
removing double ..
using third person verb for function one line summary
"summary lines must start with a third person singular present tense verb, and they must explain what the function does. Example: "Calculates the maximum weight for a list." https://www.drupal.org/node/1354#functions
taking out an unused var ($block return value)
taking out a trailing whitespace
attaching interdiff (For instructions on creating an interdiff, see https://drupal.org/documentation/git/interdiff | Microbranching workflow: http://xjm.drupalgardens.com/blog/interdiffs-how-make-them-and-why-they-... )
Comment #55
yesct commentedmanually tested.
Bartik
note #890362: Links should not be indicated by color only
and maybe #2271341: Drop button anchors easily broken by common theme styles
so that is not the problem of this issue.
Seven
==========
Needs work
a) for the super long select, (note this is both in bartik and seven) I think the width should just be the width of the longest language.
b) and also for #29: needs to show the current language, not always just the first one in the list (English)
#32 said
But without a screenshot of that at the time, I'm not sure what it exactly might have needed done.
Comment #56
lauriiiReason for current language not going to first position is as far as I know that operation form element doesn't support
#default_valueparameter. We could rearrange the array somehow by hand to get the current language as first. I attached patch for an example.Comment #57
yesct commentedreordering to put the current one first (in the operations like drop down) did work. but we should maybe only get the current language if we need to know it, so I put it inside the if.
----------
are we re-using the same input field as is used for other operations?
Our's is pushing down the stuff below it when opened, and other operations (like on the manage fields), go over other things, and do not push them down. See video: http://screencast.com/t/CdqUBaCKHnm4 (and outs is taking up the entire available width)
closed:



open (pushes stuff down)
a different operations input field that does not push stuff down, and instead overlays the next things is on the manage fields tab for node types.
This made me wonder how the languages are ordered anyway?

How should they be ordered?
Eventually, we want to show them in their localized/translated name, so Spanish would say Espanol (no matter what language the page was in). So... what order should they be? Because Alphabetical doesn't really make sense if each language name is in it's own language. I thought maybe they would be int he order they are ordered on the language config page, but they are not.
...
Anyway, other issues like #2239399: Languages should be sorted by label instead of title are having trouble with ordering languages. So let's just make the current language the one shown in the drop down (the default value or the first value), and more than that, we will not touch the ordering here.
Comment #58
yesct commentedback to needs work for the width of the drop-down
Comment #59
lewisnymanSorry to bring this up now, I don't think the dropbutton is the correct element to use in this situation. The primary action in a dropbutton, the one that always shown, should do something. See 'edit' in the language listing table. What would the primary action do with the current implementation? I don't think it would do anything.
A more appropriate element would be a select element, the value that's always shown there is the default/current value, reading over the issue that is actually what Bojhan originally suggested
Dropbuttons and select elements do look similar, but they behave differently and have different use cases.
Comment #60
yoroy commentedComment #75
quietone commentedThis must be outdated. I have been using the language switcher for testing issues for a few years now.