- Issue created by @vistree
- š¬š§United Kingdom jacobupal Leeds
I seem to have a similar issue, Drupal 10.1.6, I believe recent updates split the language switcher into two switchers, one for interface and one for content.
I think my short-term solution will be to try and prevent pointer events with css, but I would appreciate this being fixed.
Here's how the settings are panning out for me:
Content Language Switcher (using Content Language Parameter) with language_switcher_extended settings: ā āāā Untranslated Handler: 'Hide the switcher link' ā āāā SUCCESS ā āāā Untranslated Handler: 'Display the language without link' ā āāā !!!Untranslated Language is not displayed!!! ā āāā Hide single link block: True ā āāā !!!Block with single link is not hidden!!! ā āāā Current language mode: 'Hide the language Switcher Link' ā āāā SUCCESs ā āāā Current language mode: 'Display the language without link' āāā !!!Link is still there!!! Interface Language Switcher (using URL) with language_switcher_extended settings: ā āāā Untranslated Handler: 'Hide the switcher link' ā āāā SUCCESS ā āāā Untranslated Handler: 'Display the language without link' ā āāā !!!Untranslated Language is not displayed!!! ā āāā Hide single link block: True ā āāā !!!Block with single link is not hidden!!! ā āāā Current language mode: 'Hide the language Switcher Link' ā āāā Wrong language is hidden (content language is hidden, should be interface language) ā āāā Current language mode: 'Display the language without link' āāā !!!Link is still there!!!
- š©šŖGermany vistree
No activity here. I think I will remove the module and look for a different one.
- šøš®Slovenia MrMiso
Same problem. If you select Select language without link the whole language gets remove instead of just removing the link.
- šøš®Slovenia MrMiso
I checked the code and I also used the bootstrap theme and I found the following.
If code removes url (
unset($links[$langcode]['url'])
) then at least in bootstrap theme the link doesn't get generated as one of links available to links.html.twig through links variable. It is a bit dirty hack but I removed unset of url and overrided the links twig for language block as following:links--language-block.html.twig
{% if links -%} {%- if heading -%} {%- if heading.level -%} <{{ heading.level }}{{ heading.attributes }}>{{ heading.text }}</{{ heading.level }}> {%- else -%} <h2{{ heading.attributes }}>{{ heading.text }}</h2> {%- endif -%} {%- endif -%} {%- if attributes.hasClass('inline') -%} <ul{{ attributes.addClass('list-inline') }}> {%- else -%} <ul{{ attributes }}> {%- endif -%} {%- for key, item in links -%} <li{{ item.attributes.addClass(key|clean_class) }}> {%- if item.link and not item.text_attributes.hasClass('language-link--untranslated') -%} {{ item.link }} {%- elseif item.text_attributes -%} <span{{ item.text_attributes }}><s>{{ item.text }}</s></span> {%- else -%} <s>{{ item.text }}</s> {%- endif -%} </li> {%- endfor -%} </ul> {%- endif %}
Basically if it has untranslated class output it as a text instead of link.
- Status changed to Needs review
9 months ago 4:12pm 11 February 2024 - Open on Drupal.org āCore: 9.5.x + Environment: PHP 8.1 & MySQL 5.7last update
9 months ago Waiting for branch to pass - š©šŖGermany szeidler Berlin
Thanks for your detailed issue description, especially @MrMiso.
There must have indeed been a change in the language switcher rendering of links in Drupal 10, so that a link without the `#url` property is not rendered at all anymore.
Luckily there is a `
<nolink>
` route that can be used for achieving what we wanted. It seems that all your reported failures have been related to the wrong `<nolink>
` handling.Could you give the following patch a try?
- last update
9 months ago 9 pass - š¬š§United Kingdom idmacdonald
Hi,
This patch in post #6 fixed the problem for me. Thanks for that. As far as I'm concerned, this quite small patch should be merged into the module code.
- Status changed to RTBC
4 months ago 2:54pm 18 July 2024 -
szeidler ā
committed e686bb07 on 8.x-1.x
Issue #3399918 by szeidler, vistree, MrMiso, idmacdonald, jacobupal:...
-
szeidler ā
committed e686bb07 on 8.x-1.x
- Status changed to Fixed
4 months ago 2:59pm 18 July 2024 - š©šŖGermany szeidler Berlin
I committed the changes. Thanks for your inputs!
Automatically closed - issue fixed for 2 weeks with no activity.