Home›Support›English Support›[Waiting for user confirmation] I would like the language switcher show the name of the other language, not the active one
[Waiting for user confirmation] I would like the language switcher show the name of the other language, not the active one
This is the technical support forum for WPML - the multilingual WordPress plugin.
Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.
Background of the issue:
I am trying to configure the language switcher in the nav bar of my site hidden link. I want the switcher to show the name of the other language instead of the active language. The website is built using Gutenberg-blocks.
Symptoms:
The language switcher currently shows only two letters representing the active language (German), but I want it to display the name of the other language (French).
Questions:
How can I configure the language switcher-block to show the name of the other language instead of the active one?
Thank you for contacting WPML Support. Currently it’s not possible to hide the current language using the Language Switcher block. This feature request is already submitted to our developers and I’ll add your ticket link there to up vote it.
As a solution, you may try any of the below methods:
Method 1: hide the current language using CSS
1. Edit the Language Switcher block.
2. Set the “Layout” to list as you can see in the attached screenshot.
3. Add the below CSS in the custom CSS section of the theme:
Method 2: Add language switcher using shortcode
1. Go to the WPML >> Languages page.
2. Enable the Custom Language Switcher as you can see in the attached screenshot.
3. Replace the language switcher block with short code block and use the below short code: