Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
To showcase the language capabilities of Drupal core, we are adding Spanish translations to Umami in #3028769: [META] Showcase Drupal's Multilingual Capabilities by implementing Umami in a 2nd language (Spanish)
To switch between English and Spanish, Drupal's language switcher block needs to be added to the layout.
This issue should deliver an MVP version of the switcher that works responsively and provides feedback of which language is currently active.
Remaining tasks
- Add configuration to include the Language Switcher block to the pre-header region
- Theme the language switcher with suitable MVP support for the various screen sizes
- Decide whether MVP styling for the language switcher can accept the line wrapping of the switcher, search dialogue, and user menu links that will occur at smaller screen sizes. If not acceptable, style the language switcher as a drop down menu (similar to the hamburger menu) at all screen sizes.
Comment | File | Size | Author |
---|---|---|---|
#6 | interdiff-2-6.txt | 472 bytes | kjay |
#6 | drupal_umami-language-switcher-3041699-6.patch | 4.42 KB | kjay |
#5 | language-switcher-with-longer-search-box.png | 1.41 MB | shaal |
#2 | Screen Shot 2019-03-20 at 08.34.22.png | 1.92 MB | kjay |
#2 | Screen Shot 2019-03-20 at 08.34.07.png | 1.44 MB | kjay |
Comments
Comment #2
kjay CreditAttribution: kjay commentedAnd here's a first patch for this work. Proposes placing the language switcher first in order in the pre-header region and keeps the search interface centred.
Does need small refinements if we go with this approach but we need reviews and discussion on the approach.
Here's some screenshots of the result:
Comment #3
markconroy CreditAttribution: markconroy as a volunteer and at Annertech commentedHi @kjay
This looks great. Just one tiny issue reported from the linting tool:
Can you add in that new line and I'll mark RTBC then.
Comment #4
shaalDid you check what will happen when we increase the width of the search input? (#3030936: Search placeholder text is longer than the search box)
Perhaps we should keep search as an icon for a wider breakpoint until it can fit in its full width?
Comment #5
shaalI tested it together with the (upcoming) patch of wider search box, it looks great.
Comment #6
kjay CreditAttribution: kjay commentedThanks for the reviews. @markconroy, here's a patch for the missing new line at the end of language-switcher.css
@shaal, for the idea of moving the breakpoint for the search, if what we have is looking ok for MVP, I vote we go with this for now (minimal changes) but do follow up quickly with a language drop down as we're going to need that for users installing with a different language.
Comment #7
kjay CreditAttribution: kjay commentedComment #8
markconroy CreditAttribution: markconroy as a volunteer and at Annertech commentedGreat work. Thanks @kjay
Comment #10
Gábor HojtsyThanks, committed to 8.8. Leaving RTBC for merge to 8.7 once the freeze is lifted.
Comment #12
Gábor HojtsyThanks all!