Closed (fixed)
Project:
Local Association (EU Sites Project)
Version:
1.0.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
28 Jan 2026 at 14:14 UTC
Updated:
7 May 2026 at 07:15 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
esmoves commentedComment #5
stmh commentedI implemented a first version. Needs some more testing on different browsers and a review.
Comment #6
stmh commentedComment #8
evilargest commentedWhen testing the switcher, I faced a problem with the mobile styles applying on the desktop screen, so the switcher was transparent (all white on the white background). I fixed it by removing one selector, and tested on chrome/mozilla/safary afterwards, and it worked as expected. It would be great to hear feedback
Comment #9
evilargest commentedHey @stmh, me and @taran2l discussed the implementation, and two things caught our attention:
- The block is added via a Twig template and is rendered for all websites that have more than one language. However, when a website is about to introduce a new language, but they haven't translated any content on the website, they might want to have a block hidden for a while, which is not possible, as it is not added through the block layout. Also, it might be good to have it in the block layout for the sake of consistency, as all other blocks are added there
- The language block always shows a language on the pages, regardless of the page having a translation for that language or not, which results in a 404 page when trying to switch a language for such a page. In our opinion, hiding the languages on a page that has no translations can make sense.
Can you share your opinion regarding the items above?
Comment #10
stmh commentedHey,
the frontend is structured in a way that I need to "inject" the language switcher into the menu block. From a structural point of view it needs to be there. Using the block layout would require some major frontend refactoring I wanted to avoid.
Regarding the second topic: Afaik that's Drupals standard behaviour or a side effect of injecting the block via the twig function. I'd prefer a different solution, but ran out of time.
Comment #12
taran2lhi @stmh, I went ahead and refactored it a bit.
I was not able to make everything configurable; so the branding block (logo) is hardcoded in the template now, but I think it's OK
Language switcher is disabled by default, as I think that would be the case for most countries.
Comment #13
evilargest commentedI've tested the changes, and everything works perfectly locally when the language switcher is enabled.
Comment #15
taran2l