Hide the current language

Created on 26 February 2023, about 2 years ago
Updated 15 September 2023, over 1 year ago

If I have two languages such as English and Spanish it is unhlepful to give a link to "English" when already on the English page, so I want the English page to only show the link to Spanish and the Spanish page to only show the link to English.

Can I do this with the feature mentioned on the project home page "Hide the current language" - if so I can't see this feature on /admin/config/regional/language/language-switcher-extended so can anyone tell me where to find it?

💬 Support request
Status

Closed: works as designed

Version

1.1

Component

Code

Created by

🇬🇧United Kingdom juc1

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @juc1
  • Status changed to Closed: works as designed almost 2 years ago
  • 🇩🇪Germany szeidler Berlin

    Yes, that should be possible using this module. Otherwise please file a new issue.

  • 🇬🇧United Kingdom juc1

    but where can i find the option "Hide the current language" ?

    I can't see this feature on /admin/config/regional/language/language-switcher-extended

  • 🇩🇪Germany szeidler Berlin

    If I understand your request correctly this is what you're looking for.

  • 🇬🇧United Kingdom juc1

    @szeidler thanks but I think this is different question - I think your comment concerns if there is no translation for the current node then don't show the switcher because there is nothing to switch to.

    My question is - my node has two languages English and Spanish - so for the English page I want the switcher to show the link to the Spanish page but not show the link to the English page (because I am already on the English page). And vice versa - if I am on the Spanish page I want the switcher to show the link to the English page but not show the link to the Spanish page (because I am already on the Spanish page).

  • 🇬🇧United Kingdom juc1

    I have just realised that I can do this with CSS =

    .language-switcher-language-url ul.links li a.is-active {
     display: none;
    }
    
  • 🇩🇪Germany szeidler Berlin

    Great, I haven't thought about it, but that's pragmatic.

Production build 0.71.5 2024